-
Notifications
You must be signed in to change notification settings - Fork 63
/
Copy pathxtoph-deploy.sh
executable file
·62 lines (45 loc) · 1.37 KB
/
xtoph-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
#!/bin/bash
##
## NOTE: you must point to the correct inventory and extravars yml
##
## Take a sample configs from ./sample-configs and
## copy them to ./playbooks/config
##
myInventory="./config/master-config.yml"
if [[ ! -e "${myInventory}" || ! -e "./xtoph-deploy.yml" ]] ; then
echo "ERROR: Are you in the right directory? Can not find ${myInventory} | xtoph-deploy.yml" ; exit
exit
fi
##
##
##
if [[ $2 != "" ]]; then
echo "Ansible limit set to: $2"
myLimits="-l $2"
else
myLimits=""
fi
case "$1" in
"deploy" | \
"undeploy" | \
"redeploy" | \
"workshop" | \
"setup+" | \
"setup")
time ansible-playbook --ask-vault-pass -i ${myInventory} -f 10 -e xtoph_deploy_cmd=${1} ${myLimits} xtoph-deploy.yml
;;
"git-updates")
git pull
cd roles/xtoph_deploy; git pull
;;
*)
echo "USAGE: xtoph-deploy.sh [ setup | setup+ | deploy | undeploy | redeploy | workshop ]"
echo ""
echo " setup ... runs only 'setup' plays"
echo " setup+ ... runs both 'setup' and 'deploy' plays"
echo " deploy ... runs only 'deploy' plays"
echo " undeploy ... runs only 'undeploy' plays"
echo " redeploy ... runs both 'undeploy' and 'deploy' plays"
echo " workshop ... runs only the 'workshop' plays"
;;
esac