-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsite-localdev
executable file
·39 lines (31 loc) · 963 Bytes
/
site-localdev
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
#!/usr/bin/env bash
# shellcheck disable=SC2034
DIR_INC="$(cd .. && cd .. && pwd)/scripts"
# shellcheck disable=SC2034
DIR_ROOT="$(cd .. && cd .. && pwd)"
if [[ -d $DIR_INC ]]; then
source $DIR_INC/functions.sh
doPythonCheck
fi
CURRDIR="$(pwd)"
ANSIBLEPLAYBOOK=$(which ansible-playbook)
ANSIBLE=$(which ansible)
ANSIBLE_PLAYBOOK="site.yml"
ANSIBLE_INVENTORY="inventory/localdev.yml"
echo PARAMS="$@"
echo CURRDIR=$CURRDIR
cd $CURRDIR
if [[ -z $ANSIBLE ]]; then
debug "Please activate your Python Virtual Environment."
debug "You can a new virtual environment: ${PYTHON_ENV}" "info"
exit 1
fi
$ANSIBLE --version
$ANSIBLEPLAYBOOK --version
if [[ "" == "$@" ]]; then
echo $ANSIBLEPLAYBOOK -i $ANSIBLE_INVENTORY $ANSIBLE_PLAYBOOK
$ANSIBLEPLAYBOOK -i $ANSIBLE_INVENTORY $ANSIBLE_PLAYBOOK
else
echo $ANSIBLEPLAYBOOK -i $ANSIBLE_INVENTORY "$@" $ANSIBLE_PLAYBOOK
$ANSIBLEPLAYBOOK -i $ANSIBLE_INVENTORY "$@" $ANSIBLE_PLAYBOOK
fi