-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpantheon-deploy
executable file
·79 lines (64 loc) · 2.17 KB
/
pantheon-deploy
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
# Bash script to deploy a Pantheon site to the dev or live environment.
# Include all of the subscripts that we need.
DIR="${BASH_SOURCE%/*}"
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
. "$DIR/functions/pantheon-script-colours"
. "$DIR/functions/pantheon-terminus-check"
. "$DIR/functions/pantheon-authenticate"
. "$DIR/functions/pantheon-choose-site"
. "$DIR/functions/pantheon-get-framework"
. "$DIR/functions/pantheon-env-merge"
. "$DIR/functions/drupal/drupal-check-features"
. "$DIR/functions/drupal8/drupal8-check-config-management"
. "$DIR/functions/speak-message"
#set -x
SUGGESTEDSITENAME=$1
if [ "$SUGGESTEDSITENAME" == "" ]; then
terminus_check
terminus_authenticate
fi
SITENAME=''
choose_site "$SUGGESTEDSITENAME" SITENAME
FRAMEWORK=''
get_framework "$SITENAME" FRAMEWORK
echo -e "${PROTIP} If you know that your deploy is code-only (no config, or DB updates), and doesn't require a DB backup, then you can use \`pantheon-quick-deploy\`."
TARGETENV=$2
if [ "$TARGETENV" == "" ]; then
terminus multidev:list $SITENAME | grep " dev \| test \| live \| ID \|--"
read -p "${UNDERLINE}Type the name of an environment to deploy to, and press [Enter] to continue:? (test/live)${NOUNDERLINE} " TARGETENV;
fi
case $TARGETENV in
test)
SOURCEENV='dev'
echo -e "Will deploy $SITENAMEfrom dev to test"
;;
live)
SOURCEENV='test'
echo -e "Will deploy $SITENAMEfrom test to live"
;;
*)
echo -e "You can only deploy to test or live. Maybe you want the pantheon-multidev-merge script instead?"
exit 1;
;;
esac
case $FRAMEWORK in
drupal)
drupal_check_features "$SITENAME" "$SOURCEENV"
hasfeatures=$?
;;
drupal8)
drupal8_check_config_management "$SITENAME" "$SOURCEENV"
hasconfigmanagement=$?
;;
*)
echo -e "This script has no configuration management automation for $FRAMEWORK. Unless this site has Quicksilver configured, you should probably just do everything manually."
;;
esac
env_merge $SITENAME $FRAMEWORK $SOURCEENV $TARGETENV
URL=''
get_multidev_url "$SITENAME" "$TARGETENV" URL
echo -e "$URL"
echo -e "Thanks. All done."
# This typically takes a long time. Let them know.
speak_message "Deploy Complete."