-
Notifications
You must be signed in to change notification settings - Fork 1
/
terminus-update-test
executable file
·39 lines (30 loc) · 1.2 KB
/
terminus-update-test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
#
# Update script using terminus + drush to apply
# Arizona Quickstart 2 upstream & Config Distro updates
# TEST instances
#
if [[ -z ${SITE_NAME} ]]; then
echo -e "\e[31mError: SITE_NAME must be set\e[0m"
exit 1
fi
echo ""
echo -e "\e[33;44m---Updating ${SITE_NAME}.test---\e[0m"
echo ""
# Wake dev site
terminus env:wake -- ${SITE_NAME}.dev
# Create a backup of the test instance
terminus backup:create ${SITE_NAME}.test
if [[ -n ${NO_SYNC} ]]; then
terminus env:deploy ${SITE_NAME}.test --updatedb --note="Deploy core and contrib updates"
else
terminus env:deploy ${SITE_NAME}.test --sync-content --updatedb --note="Deploy core and contrib updates, update content from LIVE"
fi
CURRENT_UPSTREAM=$(terminus site:info ${SITE_NAME} --field upstream | sed 's/:.*$//g')
if [[ "${CURRENT_UPSTREAM}" == "3162cc4c-2f75-40cb-8487-0c69bda99f39" ]]; then
terminus drush ${SITE_NAME}.test -- -n -y updatedb
terminus drush ${SITE_NAME}.test -- -n -y state:set config_sync.update_mode 1 --input-format=integer
terminus drush ${SITE_NAME}.test -- -n -y config-distro-update
terminus drush ${SITE_NAME}.test -- -n -y az-core-config-add-permissions
fi
terminus env:clear-cache ${SITE_NAME}.test