-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbeanstalk_deploy.sh
64 lines (51 loc) · 1.36 KB
/
beanstalk_deploy.sh
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
#!/bin/bash
# Moves the init.php into place and runs the change scripts.
SILENT_MODE="n";
usage()
{
cat << EOF
This script will move the config (init.php) into place and run the change scripts. It is for use with Beanstalk, typically run in silent mode (-s).
OPTIONS:
-h Show this message.
-c The configuration to move to /application/init.php from application/config/inits/<config>.php
-s Execute without any confirmation. This will config move the file into place and run the change scripts without a confirmation.
Usage:
./beanstalk_deploy.sh -s -c init-production
EOF
}
while getopts c:sh optname
do
case "${optname}"
in
s) SILENT_MODE="y";;
c) CONFIG="application/config/inits/$OPTARG.php";;
h)
usage
exit 0;;
esac
done
if [[ -e "${CONFIG}" ]]; then
echo
echo "-- Copying config into place";
cp ${CONFIG} application/init.php || exit 1
fi
# just run the change scripts
if [[ $SILENT_MODE == "y" ]]; then
echo
echo "-- Running change scripts";
./minion Change:Script:Run || exit 1
# list the change scripts and then ask if they should be run
else
echo
echo "-- Listing change scripts";
./minion Change:Script:List || exit 1
read -p "Do you want to run the above change scripts? (y/n) ";
if [[ "$REPLY" == "y" ]]; then
echo
echo "-- Running change scripts";
./minion Change:Script:Run || exit 1
fi
fi
echo
echo "-- Complete";
exit 0