-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·22 lines (22 loc) · 1.24 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
case "$2" in
"") echo "Usage: run.sh deploy|(other ansible tags...) development|provisioning|debug|maintenance|tunnel [machine] [output_directory]";;
*)
case "$3" in
"") if [[ $OSTYPE == darwin* ]];
then script -q /dev/null ansible-playbook -i $SCRIPTPATH/hosts/$2 $SCRIPTPATH/playbook/site.yml -t $1 2>&1 | tee $SCRIPTPATH/$1.log;
else script -c "ansible-playbook -i $SCRIPTPATH/hosts/$2 $SCRIPTPATH/playbook/site.yml -t $1" /dev/null 2>&1 | tee $SCRIPTPATH/$1.log;
fi;;
*) case "$4" in
"") if [[ $OSTYPE == darwin* ]];
then script -q /dev/null ansible-playbook -i $SCRIPTPATH/hosts/$2 $SCRIPTPATH/playbook/site.yml -t $1 -l $3 2>&1 | tee $SCRIPTPATH/$1.log;
else script -c "ansible-playbook -i $SCRIPTPATH/hosts/$2 $SCRIPTPATH/playbook/site.yml -t $1 -l $3" /dev/null 2>&1 | tee $SCRIPTPATH/$1.log;
fi;;
*) if [[ $OSTYPE == darwin* ]];
then script -q /dev/null ansible-playbook -i $SCRIPTPATH/hosts/$2 $SCRIPTPATH/playbook/site.yml -t $1 -l $3 2>&1 | tee $4/$1.log;
else script -c "ansible-playbook -i $SCRIPTPATH/hosts/$2 $SCRIPTPATH/playbook/site.yml -t $1 -l $3" /dev/null 2>&1 | tee $4/$1.log;
fi;;
esac
esac
esac