diff --git a/README.md b/README.md index f2c7afe..69e6c68 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ git clone git@github.com:systemseed/falcon.git ``` -3. Run `make falcon install` in the root of repository. Profit! +3. Run `make falcon:install` in the root of repository. Profit! 4. TODO diff --git a/backend-donations/config/sync/README.txt b/backend-donations/config/sync/README.txt new file mode 100644 index 0000000..37874bd --- /dev/null +++ b/backend-donations/config/sync/README.txt @@ -0,0 +1 @@ +This directory contains configuration to be imported into your Drupal site. To make this configuration active, visit admin/config/development/configuration/sync. For information about deploying configuration between servers, see https://www.drupal.org/documentation/administer/config \ No newline at end of file diff --git a/backend-donations/web/modules/falcon/falcon_development/falcon_development.install b/backend-donations/web/modules/falcon/falcon_development/falcon_development.install index b8e210c..21d6b77 100644 --- a/backend-donations/web/modules/falcon/falcon_development/falcon_development.install +++ b/backend-donations/web/modules/falcon/falcon_development/falcon_development.install @@ -37,6 +37,7 @@ function activateTestUsers() { $account->enforceIsNew(); $account->setEmail('test+falcon-' . $role->id() . '@systemseed.com'); $account->setUsername($role->id() . '.test'); + $account->activate(); if ($role->id() !== 'authenticated') { $account->addRole($role->id()); diff --git a/backend-donations/web/sites/development.services.yml b/backend-donations/web/sites/default/services.development.yml similarity index 100% rename from backend-donations/web/sites/development.services.yml rename to backend-donations/web/sites/default/services.development.yml diff --git a/backend-donations/web/sites/services.yml b/backend-donations/web/sites/default/services.yml similarity index 100% rename from backend-donations/web/sites/services.yml rename to backend-donations/web/sites/default/services.yml diff --git a/backend-donations/web/sites/default/settings.local.php b/backend-donations/web/sites/default/settings.local.php index 059c93b..cf23c6d 100644 --- a/backend-donations/web/sites/default/settings.local.php +++ b/backend-donations/web/sites/default/settings.local.php @@ -14,7 +14,7 @@ $settings['file_private_path'] = preg_replace('~/web$~', '/private', $app_root); // Enable local development services. -$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml'; +$settings['container_yamls'][] = __DIR__ . '/services.development.yml'; // Configure base url for images going outside of the site. $config['rest_absolute_urls']['base_url'] = 'http://donations.api.flc.local'; diff --git a/backend-donations/web/sites/default/settings.php b/backend-donations/web/sites/default/settings.php index a388a84..fd87d30 100644 --- a/backend-donations/web/sites/default/settings.php +++ b/backend-donations/web/sites/default/settings.php @@ -4,7 +4,7 @@ $databases = []; $config_directories = []; $settings['update_free_access'] = FALSE; -$settings['container_yamls'][] = $app_root . '/services.yml'; +$settings['container_yamls'][] = __DIR__ . '/services.yml'; $settings['file_scan_ignore_directories'] = [ 'node_modules', 'bower_components', diff --git a/backend-gifts/web/modules/falcon/falcon_development/falcon_development.install b/backend-gifts/web/modules/falcon/falcon_development/falcon_development.install index b8e210c..21d6b77 100644 --- a/backend-gifts/web/modules/falcon/falcon_development/falcon_development.install +++ b/backend-gifts/web/modules/falcon/falcon_development/falcon_development.install @@ -37,6 +37,7 @@ function activateTestUsers() { $account->enforceIsNew(); $account->setEmail('test+falcon-' . $role->id() . '@systemseed.com'); $account->setUsername($role->id() . '.test'); + $account->activate(); if ($role->id() !== 'authenticated') { $account->addRole($role->id()); diff --git a/backend-gifts/web/sites/development.services.yml b/backend-gifts/web/sites/default/services.development.yml similarity index 100% rename from backend-gifts/web/sites/development.services.yml rename to backend-gifts/web/sites/default/services.development.yml diff --git a/backend-gifts/web/sites/services.yml b/backend-gifts/web/sites/default/services.yml similarity index 100% rename from backend-gifts/web/sites/services.yml rename to backend-gifts/web/sites/default/services.yml diff --git a/backend-gifts/web/sites/default/settings.local.php b/backend-gifts/web/sites/default/settings.local.php index a073d00..ed5fe11 100644 --- a/backend-gifts/web/sites/default/settings.local.php +++ b/backend-gifts/web/sites/default/settings.local.php @@ -11,7 +11,7 @@ $config['system.logging']['error_level'] = 'verbose'; // Enable local development services. -$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml'; +$settings['container_yamls'][] = __DIR__ . '/services.development.yml'; // Set private files folder. $settings['file_private_path'] = preg_replace('~/web$~', '/private', $app_root); diff --git a/backend-gifts/web/sites/default/settings.php b/backend-gifts/web/sites/default/settings.php index add51c8..33eade4 100644 --- a/backend-gifts/web/sites/default/settings.php +++ b/backend-gifts/web/sites/default/settings.php @@ -4,7 +4,7 @@ $databases = []; $config_directories = []; $settings['update_free_access'] = FALSE; -$settings['container_yamls'][] = $app_root . '/services.yml'; +$settings['container_yamls'][] = __DIR__ . '/services.yml'; $settings['file_scan_ignore_directories'] = [ 'node_modules', 'bower_components', diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 407b6ab..87aa9f1 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -55,6 +55,8 @@ services: be_gifts: image: wodby/drupal-php:7.1-dev-4.2.3 + depends_on: + - be_gifts_mariadb environment: PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025 DB_HOST: drupal @@ -64,7 +66,7 @@ services: DB_DRIVER: mysql be_gifts_mariadb: - image: wodby/mariadb:10.2-3.1.3 + image: wodby/mariadb:10.1-3.1.3 stop_grace_period: 30s environment: MYSQL_ROOT_PASSWORD: drupal @@ -104,6 +106,8 @@ services: be_donations: image: wodby/drupal-php:7.1-dev-4.2.3 + depends_on: + - be_donations_mariadb environment: PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025 DB_HOST: drupal @@ -113,7 +117,7 @@ services: DB_DRIVER: mysql be_donations_mariadb: - image: wodby/mariadb:10.2-3.1.3 + image: wodby/mariadb:10.1-3.1.3 stop_grace_period: 30s environment: MYSQL_ROOT_PASSWORD: drupal diff --git a/local-prepare.sh b/local-prepare.sh deleted file mode 100755 index 27efd8a..0000000 --- a/local-prepare.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env bash - -# Install composer inside of Api Bus. -docker-compose run api_bus composer install - -# Install composer inside of Gifts Backend. -docker-compose run be_gifts composer install - -# Install composer inside of Gifts Backend. -docker-compose run be_donations composer install - -# Install npm dependencies of Gifts Frontend. -docker-compose run fe_gifts yarn install - -# Install npm dependencies of Gifts Frontend. -docker-compose run fe_main yarn install - -# Do the necessary step to configure API bus initially. -cp ./backend-api-bus/src/config/local.default.php ./backend-api-bus/src/config/local.php - -# Boot the dev environments. -docker-compose up -d - -read -p "Would you like to reinstall the platform? IMPORTANT: it will remove existing data in your databases. [Y/n]" -n 1 -r -echo -if [[ $REPLY =~ ^[Yy]$ ]] -then - # Prepares certificates for Gifts backend. - docker-compose run be_gifts openssl genrsa -out ./certificates/private.key 2048 - docker-compose run be_gifts openssl rsa -in ./certificates/private.key -pubout > backend-gifts/certificates/public.key - - # Use generated keys for Donations backend. - cp ./backend-gifts/certificates/public.key ./backend-donations/certificates/public.key - cp ./backend-gifts/certificates/private.key ./backend-donations/certificates/private.key - - # Run site installation. - docker-compose run be_gifts drush site-install config_installer --root='./web' --yes - # To create a demo content. - docker-compose run be_gifts drush en falcon_demo_content --root='./web' --yes - # Disable unnecessary modules. - docker-compose run be_gifts drush pmu falcon_demo_content default_content better_normalizers hal --root='./web' --yes - - # Run site installation. - docker-compose run be_donations drush site-install config_installer --root='./web' --yes - # To create a demo content. - docker-compose run be_donations drush en falcon_demo_content --root='./web' --yes - # Disable unnecessary modules. - docker-compose run be_donations drush pmu falcon_demo_content default_content better_normalizers hal --root='./web' --yes -fi diff --git a/local-sql-dump.sh b/local-sql-dump.sh deleted file mode 100755 index a96feb2..0000000 --- a/local-sql-dump.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash - -# TODO: Replace with your platform.sh project ID. -PROJECT_ID="fsdfsdfsfdfaaa" -PSH_ENV=master -DB_CONTAINERS=("be_donations_mariadb" "be_gifts_mariadb") - -# If number of args passed is greater than 0 -if [ $# -gt 0 ]; then - PSH_ENV=$1 -fi - -# Dump database for DONATIONS backend. -echo "Dumping Donations database..." -platform db:dump -y --project=$PROJECT_ID --environment=${PSH_ENV} --app=backend-donations --file=./backend-donations/mysql/init/dump.sql - -# Dump database for GIFTS backend. -echo "Dumping Gifts database..." -platform db:dump -y --project=$PROJECT_ID --environment=${PSH_ENV} --app=backend-gifts --file=./backend-gifts/mysql/init/dump.sql - -# Loop over the containers and rebuild them. -for CONTAINER in "${DB_CONTAINERS[@]}" -do - # Kill container if it's already running. - if docker-compose ps ${CONTAINER} | grep -q Up; then - docker-compose kill ${CONTAINER} - fi - # If the container is dead then remove it. - if docker-compose ps ${CONTAINER} | grep -q Exit; then - docker-compose rm -f ${CONTAINER} - fi - - # When starting it will use the new DB dump. - docker-compose up -d ${CONTAINER} -done