This repository has been archived by the owner on Feb 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'project/master'
- Loading branch information
Showing
10 changed files
with
199 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
/** | ||
* This is the global runtime configuration for Yves and Generated_Yves_Zed in a development environment. | ||
*/ | ||
|
||
use Spryker\Shared\Application\ApplicationConstants; | ||
use Spryker\Shared\Payone\PayoneConstants; | ||
use Spryker\Shared\Session\SessionConstants; | ||
use Spryker\Shared\Storage\StorageConstants; | ||
|
||
$config[SessionConstants::YVES_SESSION_SAVE_HANDLER] = SessionConstants::SESSION_HANDLER_REDIS; | ||
$config[SessionConstants::ZED_SESSION_SAVE_HANDLER] = SessionConstants::SESSION_HANDLER_FILE; | ||
|
||
$config[StorageConstants::STORAGE_REDIS_PROTOCOL] = 'tcp'; | ||
$config[StorageConstants::STORAGE_REDIS_HOST] = '127.0.0.1'; | ||
$config[StorageConstants::STORAGE_REDIS_PORT] = '10009'; | ||
$config[StorageConstants::STORAGE_REDIS_PASSWORD] = ''; | ||
$config[StorageConstants::STORAGE_REDIS_DATABASE] = 3; | ||
|
||
$config[SessionConstants::YVES_SESSION_REDIS_PROTOCOL] = $config[StorageConstants::STORAGE_REDIS_PROTOCOL]; | ||
$config[SessionConstants::YVES_SESSION_REDIS_HOST] = $config[StorageConstants::STORAGE_REDIS_HOST]; | ||
$config[SessionConstants::YVES_SESSION_REDIS_PORT] = $config[StorageConstants::STORAGE_REDIS_PORT]; | ||
$config[SessionConstants::YVES_SESSION_REDIS_PASSWORD] = $config[StorageConstants::STORAGE_REDIS_PASSWORD]; | ||
$config[SessionConstants::YVES_SESSION_REDIS_DATABASE] = 4; | ||
|
||
$config[SessionConstants::ZED_SESSION_REDIS_PROTOCOL] = $config[SessionConstants::YVES_SESSION_REDIS_PROTOCOL]; | ||
$config[SessionConstants::ZED_SESSION_REDIS_HOST] = $config[SessionConstants::YVES_SESSION_REDIS_HOST]; | ||
$config[SessionConstants::ZED_SESSION_REDIS_PORT] = $config[SessionConstants::YVES_SESSION_REDIS_PORT]; | ||
$config[SessionConstants::ZED_SESSION_REDIS_PASSWORD] = $config[SessionConstants::YVES_SESSION_REDIS_PASSWORD]; | ||
|
||
$config[SessionConstants::SESSION_IS_TEST] = false; | ||
|
||
$config[PayoneConstants::PAYONE] = [ | ||
PayoneConstants::PAYONE_MODE => '', | ||
]; | ||
|
||
$config[ApplicationConstants::JENKINS_BASE_URL] = 'http://' . $config[ApplicationConstants::HOST_ZED_GUI] . ':10007/jenkins'; | ||
$config[ApplicationConstants::JENKINS_DIRECTORY] = '/data/shop/development/shared/data/common/jenkins'; | ||
|
||
$config[ApplicationConstants::APPLICATION_SPRYKER_ROOT] = APPLICATION_ROOT_DIR . '/vendor/spryker/spryker/Bundles'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
/** | ||
* This is the global runtime configuration for Yves and Generated_Yves_Zed in a devtest environment. | ||
*/ | ||
|
||
use Spryker\Shared\Application\ApplicationConstants; | ||
|
||
$config[ApplicationConstants::ZED_DB_ENGINE] = $config[ApplicationConstants::ZED_DB_ENGINE_PGSQL]; | ||
$config[ApplicationConstants::ZED_DB_USERNAME] = 'devtest'; | ||
$config[ApplicationConstants::ZED_DB_PASSWORD] = 'mate20mg'; | ||
$config[ApplicationConstants::ZED_DB_DATABASE] = 'DE_devtest_zed'; | ||
$config[ApplicationConstants::ZED_DB_HOST] = '127.0.0.1'; | ||
$config[ApplicationConstants::ZED_DB_PORT] = 5432; | ||
|
||
$config[ApplicationConstants::ELASTICA_PARAMETER__INDEX_NAME] = 'de_search_devtest'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
#!/bin/bash | ||
|
||
set -o pipefail | ||
|
||
SETUP='spryker' | ||
DEVELOPMENT_DATABASE_NAME='DE_development_zed' | ||
DATABASE_NAME='DE_devtest_zed' | ||
DATABASE_USER='devtest' | ||
DATABASE_PASSWORD='mate20mg' | ||
VERBOSITY='-v' | ||
CONSOLE=vendor/bin/console | ||
PHANTOMJS_CDNURL='https://github.com/Medium/phantomjs/' | ||
DATABASE_BACKUP_PATH='data/test.backup' | ||
|
||
export APPLICATION_ENV='devtest' | ||
|
||
. deploy/setup/functions.sh | ||
|
||
warningText "This script should be used only in development and NEVER IN PRODUCTION" | ||
|
||
function backupTestingEnvData { | ||
|
||
dropDevelopmentDatabase | ||
|
||
labelText "Running setup:install" | ||
$CONSOLE setup:install $VERBOSITY | ||
writeErrorMessage "Setup install failed" | ||
|
||
labelText "Running propel code generation/migrations" | ||
$CONSOLE propel:install $VERBOSITY | ||
$CONSOLE propel:diff $VERBOSITY | ||
$CONSOLE propel:migrate $VERBOSITY | ||
|
||
labelText "Importing Demo data" | ||
$CONSOLE import:demo-data $VERBOSITY | ||
writeErrorMessage "DemoData import failed" | ||
|
||
labelText "Initializing DB" | ||
$CONSOLE setup:init-db $VERBOSITY | ||
writeErrorMessage "DB setup failed" | ||
|
||
runCollectors | ||
|
||
backupDevelopmentForTests | ||
|
||
successText "Backup successful." | ||
} | ||
|
||
function restoreTestingEnvData { | ||
dropAndRestoreDatabase $DATABASE_BACKUP_PATH | ||
} | ||
|
||
function backupDevelopmentForTests { | ||
export PGPASSWORD=$DATABASE_PASSWORD | ||
export LC_ALL="en_US.UTF-8" | ||
|
||
pg_dump -i -h 127.0.0.1 -U $DATABASE_USER -F c -b -v -f $DATABASE_BACKUP_PATH $DATABASE_NAME | ||
} | ||
|
||
function runCollectors() { | ||
export PGPASSWORD=$DATABASE_PASSWORD | ||
labelText "Reset touch table." | ||
psql -h 127.0.0.1 -U $DATABASE_USER -d $DATABASE_NAME -c 'UPDATE spy_touch set touched=now()' -w | ||
|
||
labelText "Run collectors." | ||
$CONSOLE collector:search:export $VERBOSITY | ||
$CONSOLE collector:storage:export $VERBOSITY | ||
} | ||
|
||
if [ $# -eq 0 ]; then | ||
displayHelp | ||
exit 0 | ||
fi | ||
|
||
for arg in "$@" | ||
do | ||
case $arg in | ||
|
||
"--restore" | "-r" ) | ||
restoreTestingEnvData | ||
;; | ||
|
||
"--backup" | "-b" ) | ||
backupTestingEnvData | ||
;; | ||
"--collectors" | "-c" ) | ||
runCollectors | ||
;; | ||
|
||
*) | ||
displayHeader | ||
echo "" | ||
echo "Unrecognized option: $@. Use -h to display help." | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
|
||
exit 0 | ||
|