Skip to content

Commit 625cd9c

Browse files
authored
Merge pull request #120 from humpbackdev/feature/fix-import-config-issue
Add the import with existing config
2 parents fc334a7 + 01e3868 commit 625cd9c

File tree

6 files changed

+42
-13
lines changed

6 files changed

+42
-13
lines changed

generators/app/templates/deploy-environment/Pantheon/circleci/config.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@ jobs:
4343
composer install
4444
chmod 777 -R ./web/sites/default/files
4545
cd web
46-
if [ -f /var/www/<%= appName %>/config/sync/core.extension.yml ] ; then echo 'Install with config' ; /usr/bin/env PHP_OPTIONS="-d sendmail_path=`which true`" ../vendor/bin/drush si <%= appName %> -y ; ../vendor/bin/drush config-set "system.site" uuid $SITE_UUID -y ; ../vendor/bin/drush cim -y ; else echo 'Install without config' ; /usr/bin/env PHP_OPTIONS="-d sendmail_path=`which true`" ../vendor/bin/drush si <%= appName %> -y ; fi
46+
/usr/bin/env PHP_OPTIONS="-d sendmail_path=`which true`"
47+
if [ -f /var/www/<%= appName %>/config/sync/core.extension.yml ]; then
48+
echo "Installing with existing config..."
49+
../vendor/bin/drush si standard --config-dir="sites/default/config/sync" -y
50+
else
51+
echo 'Install without config ...'
52+
../vendor/bin/drush si standard -y
53+
fi
4754
cd /var/www/<%= appName %>
4855
- run:
4956
name: Coding Standards Linters
@@ -156,10 +163,9 @@ jobs:
156163
terminus connection:set <%= dashedAppName %>.dev git
157164
ahoy site deploy master "Auto deploy triggered from master branch"
158165
terminus connection:set <%= dashedAppName %>.dev sftp
159-
terminus drush <%= dashedAppName %>.dev -- si <%= appName %> --account-pass=admin -y
166+
terminus drush <%= dashedAppName %>.dev -- si <%= appName %> --account-pass=admin --config-dir="sites/default/config/sync" -y
160167
terminus connection:set <%= dashedAppName %>.dev git
161168
terminus drush <%= dashedAppName %>.dev -- config-set "system.site" uuid "$SITE_UUID" -y
162-
terminus drush <%= dashedAppName %>.dev -- cim -y
163169
terminus drush <%= dashedAppName %>.dev -- cr
164170
deploy-test:
165171
docker:

generators/app/templates/deploy-environment/Pantheon/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
"kporras07/composer-symlinks": "dev-master",
2121
"drupal/core-recommended": "<%= coreVersion %>",
2222
"cweagans/composer-patches": "^1.6.5",
23-
"pantheon-systems/drupal-integrations": "^8.0"
23+
"pantheon-systems/drupal-integrations": "^8.0",
24+
"drush/drush": "^9.7.1 | ^10.0.0",
2425
},
2526
"require-dev": {
2627
"testdrupal/behatextension": "dev-update",
27-
"drush/drush": "^9.7.1 | ^10.0.0",
2828
"squizlabs/php_codesniffer": "^3.5",
2929
"drupal/coder": "^8.2",
3030
"behat/behat": "3.4.0",

generators/app/templates/deploy-environment/Pantheon/site.ahoy.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ commands:
2222
find ./web/libraries/ -name ".git" -exec rm -rf {} \;
2323
find ./web/sites/all/libraries/ -name ".git" -exec rm -rf {} \;
2424
cp -r web $CLONEFOLDER/web
25+
cp -r {package.json,package-lock.json} $CLONEFOLDER
2526
mv vendor $CLONEFOLDER/
2627
cp pantheon.yml $CLONEFOLDER/
2728
cd $CLONEFOLDER
@@ -51,9 +52,17 @@ commands:
5152
install:
5253
usage: Run install commands
5354
cmd: |
55+
SITE_UUID="<%= siteUuid %>"
5456
ahoy drush cc drush
55-
echo "Installing..."
56-
ahoy drush site-install standard --account-pass=admin --site-name="<%= humanName %>" -y
57+
if [ -f ./config/sync/core.extension.yml ]; then
58+
echo "Installing with existing config..."
59+
ahoy drush site-install standard --account-pass=admin --site-name="<%= humanName %>" --config-dir="sites/default/config/sync" -y
60+
else
61+
echo "Installing the new site..."
62+
ahoy drush site-install standard --account-pass=admin --site-name="<%= humanName %>" -y
63+
echo "Set site uuid..."
64+
ahoy drush config-set "system.site" uuid "$SITE_UUID" -y
65+
fi
5766
echo "Cleaning cache..."
5867
ahoy drush cr
5968
install-from-db:

generators/app/templates/deploy-environment/Platformsh/circleci/config.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@ jobs:
4343
composer install
4444
chmod 777 -R ./web/sites/default/files
4545
cd web
46-
if [ -f /var/www/<%= appName %>/config/sync/core.extension.yml ] ; then echo 'Install with config' ; /usr/bin/env PHP_OPTIONS="-d sendmail_path=`which true`" ../vendor/bin/drush si standard -y ; ../vendor/bin/drush cim -y ; else echo 'Install without config' ; /usr/bin/env PHP_OPTIONS="-d sendmail_path=`which true`" ../vendor/bin/drush si standard -y ; fi
46+
/usr/bin/env PHP_OPTIONS="-d sendmail_path=`which true`"
47+
if [ -f /var/www/<%= appName %>/config/sync/core.extension.yml ]; then
48+
echo "Installing with existing config..."
49+
../vendor/bin/drush si standard --config-dir="sites/default/config/sync" -y
50+
else
51+
echo 'Install without config ...'
52+
../vendor/bin/drush si standard -y
53+
fi
4754
cd /var/www/<%= appName %>
4855
- run:
4956
name: Coding Standards Linters

generators/app/templates/deploy-environment/Platformsh/composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"drupal/core-recommended": "<%= coreVersion %>",
2222
"cweagans/composer-patches": "^1.6.5",
2323
"drupal/redis": "^1.4",
24-
"drupal/search_api_solr": "^3.9",
24+
"drupal/search_api_solr": "^4.0",
2525
"drush/drush": "^9.7.1 | ^10.0.0",
2626
"platformsh/config-reader": "^2.3",
2727
"symfony/event-dispatcher": "4.3.4 as 3.4.35"
@@ -82,8 +82,7 @@
8282
"root/.gitignore": "web/.gitignore",
8383
"settings/settings.php": "web/sites/default/settings.php",
8484
"settings/settings.local.php": "web/sites/default/settings.local.php",
85-
"settings/settings.platformsh.php":
86-
"web/sites/default/settings.platformsh.php",
85+
"settings/settings.platformsh.php": "web/sites/default/settings.platformsh.php",
8786
"settings/settings.secret.php": "web/sites/default/settings.secret.php",
8887
"settings/services.yml": "web/sites/default/services.yml",
8988
"settings/services.local.yml": "web/sites/default/services.local.yml",

generators/app/templates/deploy-environment/Platformsh/site.ahoy.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,17 @@ commands:
3737
install:
3838
usage: Run install commands
3939
cmd: |
40+
SITE_UUID="<%= siteUuid %>"
4041
ahoy drush cc drush
41-
echo "Installing..."
42-
ahoy drush site-install standard --account-pass=admin --site-name="<%= humanName %>" -y
42+
if [ -f ./config/sync/core.extension.yml ]; then
43+
echo "Installing with existing config..."
44+
ahoy drush site-install standard --account-pass=admin --site-name="<%= humanName %>" --config-dir="sites/default/config/sync" -y
45+
else
46+
echo "Installing the new site..."
47+
ahoy drush site-install standard --account-pass=admin --site-name="<%= humanName %>" -y
48+
echo "Set site uuid..."
49+
ahoy drush config-set "system.site" uuid "$SITE_UUID" -y
50+
fi
4351
echo "Cleaning cache..."
4452
ahoy drush cr
4553
install-from-db:

0 commit comments

Comments
 (0)