Skip to content
This repository has been archived by the owner on Feb 4, 2019. It is now read-only.

Commit

Permalink
Update URLs to new convention
Browse files Browse the repository at this point in the history
  • Loading branch information
marek-obuchowicz committed Sep 15, 2016
1 parent b69c36d commit 16f0a8c
Show file tree
Hide file tree
Showing 8 changed files with 144 additions and 26 deletions.
2 changes: 1 addition & 1 deletion codeception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ modules:
coverage:
enabled: true
remote: true
c3_url: 'http://zed.de.spryker.dev'
c3_url: 'http://zed.de.project.local'
whitelist: { include: ['src/*.php'] }

extensions:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Project",
"license": "MIT",
"require": {
"spryker/spryker": "dev-master",
"spryker/spryker": "dev-testing_enviroment",
"php": "~5.6.0",
"braintree/braintree_php": "~3.15.0",
"guzzlehttp/guzzle": "~6.2.1",
Expand Down
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions config/Shared/config_default-development_DE.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
$config[ApplicationConstants::ZED_DB_ENGINE] = $config[ApplicationConstants::ZED_DB_ENGINE_PGSQL];
$config[ApplicationConstants::ZED_DB_PORT] = 5432;

$yvesHost = 'www.de.spryker.dev';
$yvesHost = 'www.de.project.local';
$config[ApplicationConstants::HOST_YVES] = 'http://' . $yvesHost;
$config[ApplicationConstants::HOST_STATIC_ASSETS] = $config[ApplicationConstants::HOST_STATIC_MEDIA] = $yvesHost;
$config[SessionConstants::YVES_SESSION_COOKIE_DOMAIN] = $yvesHost;

$config[ApplicationConstants::HOST_SSL_YVES] = 'https://' . $yvesHost;
$config[ApplicationConstants::HOST_SSL_STATIC_ASSETS] = $config[ApplicationConstants::HOST_SSL_STATIC_MEDIA] = $yvesHost;

$zedHost = 'zed.de.spryker.dev';
$zedHost = 'zed.de.project.local';
$config[ApplicationConstants::HOST_ZED_GUI]
= 'http://' . $zedHost;
$config[ApplicationConstants::HOST_ZED_API] = $zedHost;
Expand All @@ -31,8 +31,8 @@
$config[SessionConstants::ZED_SESSION_COOKIE_NAME] = $zedHost;
$config[SessionConstants::ZED_SESSION_COOKIE_SECURE] = false;

$config[ApplicationConstants::CLOUD_CDN_STATIC_MEDIA_HTTP] = 'http://static.de.spryker.dev';
$config[ApplicationConstants::CLOUD_CDN_STATIC_MEDIA_HTTPS] = 'https://static.de.spryker.dev';
$config[ApplicationConstants::CLOUD_CDN_STATIC_MEDIA_HTTP] = 'http://static.project.local';
$config[ApplicationConstants::CLOUD_CDN_STATIC_MEDIA_HTTPS] = 'https://static.project.local';

$config[ApplicationConstants::JENKINS_BASE_URL] = 'http://localhost:10007/';
$config[MailConstants::MAILCATCHER_GUI] = 'http://' . $config[ApplicationConstants::HOST_ZED_GUI] . ':1080';
Expand Down
12 changes: 6 additions & 6 deletions config/Shared/config_default-development_US.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
use Spryker\Shared\Application\ApplicationConstants;
use Spryker\Shared\Mail\MailConstants;

$yvesHost = 'www.com.spryker.dev';
$yvesHost = 'www.com.project.local';
$config[ApplicationConstants::HOST_YVES] = 'http://' . $yvesHost;
$config[ApplicationConstants::HOST_STATIC_ASSETS] = $config[ApplicationConstants::HOST_STATIC_MEDIA] = $yvesHost;

$config[ApplicationConstants::HOST_SSL_YVES] = 'https://' . $yvesHost;
$config[ApplicationConstants::HOST_SSL_STATIC_ASSETS] = $config[ApplicationConstants::HOST_SSL_STATIC_MEDIA] = $yvesHost;

$zedHost = 'zed.com.spryker.dev';
$zedHost = 'zed.com.project.local';
$config[ApplicationConstants::HOST_ZED_GUI]
= $config[ApplicationConstants::HOST_ZED_API]
= 'http://' . $zedHost;
Expand All @@ -20,17 +20,17 @@

$config[ApplicationConstants::YVES_TRUSTED_HOSTS] = [$yvesHost, $zedHost];

$config[ApplicationConstants::CLOUD_CDN_STATIC_MEDIA_HTTP] = 'http://static.com.spryker.dev';
$config[ApplicationConstants::CLOUD_CDN_STATIC_MEDIA_HTTPS] = 'https://static.com.spryker.dev';
$config[ApplicationConstants::CLOUD_CDN_STATIC_MEDIA_HTTP] = 'http://static.project.local';
$config[ApplicationConstants::CLOUD_CDN_STATIC_MEDIA_HTTPS] = 'https://static.project.local';

$config[MailConstants::MAILCATCHER_GUI] = 'http://' . $config[ApplicationConstants::HOST_ZED_GUI] . ':1080';

/* RabbitMQ */
$config[ApplicationConstants::ZED_RABBITMQ_HOST] = 'localhost';
$config[ApplicationConstants::ZED_RABBITMQ_PORT] = '5672';
$config[ApplicationConstants::ZED_RABBITMQ_USERNAME] = 'DE_development';
$config[ApplicationConstants::ZED_RABBITMQ_USERNAME] = 'US_development';
$config[ApplicationConstants::ZED_RABBITMQ_PASSWORD] = 'mate20mg';
$config[ApplicationConstants::ZED_RABBITMQ_VHOST] = '/DE_development_zed';
$config[ApplicationConstants::ZED_RABBITMQ_VHOST] = '/US_development_zed';

/* Elasticsearch */
$config[ApplicationConstants::ELASTICA_PARAMETER__INDEX_NAME] = 'us_search';
1 change: 1 addition & 0 deletions config/Shared/config_default.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
*/
$config[SearchConstants::SEARCH_CONFIG_CACHE_KEY] = 'search_config_cache';
$config[SearchConstants::FULL_TEXT_BOOSTED_BOOSTING_VALUE] = 3;
$config[SearchConstants::SEARCH_INDEX_NAME_SUFFIX] = '';

/**
* Hostname(s) for Yves - Shop frontend
Expand Down
34 changes: 25 additions & 9 deletions deploy/setup/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,27 +80,43 @@ function dumpDevelopmentDatabase {
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_NAME.backup $DATABASE_NAME
if [[ -z "$1" ]]; then
DATABASE_BACKUP_PATH=$DATABASE_NAME.backup;
else
DATABASE_BACKUP_PATH=$1
fi

pg_dump -i -h 127.0.0.1 -U $DATABASE_USER -F c -b -v -f $DATABASE_BACKUP_PATH $DATABASE_NAME
}

function restoreDevelopmentDatabase {
read -r -p "Restore database ${DATABASE_NAME} ? [y/N] " response
case $response in
[yY][eE][sS]|[yY])
export PGPASSWORD=$DATABASE_PASSWORD
export LC_ALL="en_US.UTF-8"

sudo pg_ctlcluster 9.4 main restart --force
sudo dropdb $DATABASE_NAME
sudo createdb $DATABASE_NAME
pg_restore -i -h 127.0.0.1 -p 5432 -U $DATABASE_USER -d $DATABASE_NAME -v $DATABASE_NAME.backup
dropAndRestoreDatabase
;;
*)
echo "Nothing done."
;;
esac
}

function dropAndRestoreDatabase {
if [[ -z "$1" ]]; then
DATABASE_BACKUP_PATH=$DATABASE_NAME.backup;
else
DATABASE_BACKUP_PATH=$1
fi

export PGPASSWORD=$DATABASE_PASSWORD
export LC_ALL="en_US.UTF-8"

sudo pg_ctlcluster 9.4 main restart --force
sudo dropdb $DATABASE_NAME
sudo createdb $DATABASE_NAME
pg_restore -i -h 127.0.0.1 -p 5432 -U $DATABASE_USER -d $DATABASE_NAME -v $DATABASE_BACKUP_PATH
}

function installDemoshop {
labelText "Preparing to install Spryker Platform..."

Expand All @@ -114,7 +130,7 @@ function installDemoshop {
configureCodeception

successText "Setup successful"
infoText "\nYves URL: http://www.de.spryker.dev/\nZed URL: http://zed.de.spryker.dev/\n"
infoText "\nYves URL: http://www.de.project.local/\nZed URL: http://zed.de.project.local/\n"
}

function installZed {
Expand Down
101 changes: 101 additions & 0 deletions setup_test
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

0 comments on commit 16f0a8c

Please sign in to comment.