Skip to content

Commit 0385394

Browse files
committed
fix refresh content script
1 parent 36bc923 commit 0385394

1 file changed

Lines changed: 20 additions & 27 deletions

File tree

uceap-drupal-dev-refresh-content

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,23 @@ composer install
1919
# re-build the theme (likewise in case of changes)
2020
composer compile-theme
2121

22-
# during first run, the new PATH from the on-create script is not yet in effect
23-
if ( ! command -v drush > /dev/null ); then
24-
export PATH="`pwd`/vendor/bin:$PATH"
25-
fi
26-
27-
# FIXME
28-
# this script used to download database/files from github packages
29-
# now we need to download from pantheon backups instead
30-
# tar zx --no-same-permissions --strip-components 1 -C web/sites/default/files -f files.tar.gz
31-
# rm files.tar.gz
32-
33-
# # no-same-permissions doesn't seem to work so we fix it here
34-
# sudo find web/sites/default/files -type d -exec chmod g+ws {} +
35-
# sudo find web/sites/default/files -type f -exec chmod g+w {} +
36-
37-
# the first time we run this script the default umask is still in effect,
38-
# which messes up permissions on the profiler directory that gets created when the caches are rebuilt by db-rebuild.sh
39-
umask 002
40-
41-
sudo service mariadb start
42-
# build/db-rebuild.sh database.sql.gz
43-
# rm database.sql.gz
44-
45-
# Run local devcontainer lifecycle scripts
46-
if [ -x .devcontainer/updateContent.sh ]; then
47-
.devcontainer/updateContent.sh
48-
fi
22+
# download pantheon backups
23+
export TERMINUS_ENV="dev"
24+
FILES_BACKUP=$(mktemp --dry-run files-XXXXXX.tar.gz)
25+
DATABASE_BACKUP=$(mktemp --dry-run database-XXXXXX.sql.gz)
26+
terminus backup:get --element=files --to=$FILES_BACKUP
27+
terminus backup:get --element=db --to=$DATABASE_BACKUP
28+
29+
rm -rf web/sites/default/files
30+
mkdir web/sites/default/files
31+
chgrp www-data web/sites/default/files
32+
chmod 2775 web/sites/default/files
33+
tar zx --no-same-permissions --strip-components 1 -C web/sites/default/files -f $FILES_BACKUP
34+
# no-same-permissions doesn't seem to work so we fix it here
35+
sudo find web/sites/default/files -type d -exec chmod g+ws {} +
36+
sudo find web/sites/default/files -type f -exec chmod g+w {} +
37+
38+
build/db-rebuild.sh $DATABASE_BACKUP
39+
40+
rm $FILES_BACKUP
41+
rm $DATABASE_BACKUP

0 commit comments

Comments
 (0)