-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·49 lines (39 loc) · 1.23 KB
/
install.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
#!/bin/bash
set -e
xcode-select -p
if [ $? -ne 0 ]; then
xcode-select --install
fi
ANSIBLE_ENV_SETUP=vendor/ansible/hacking/env-setup
VIRTUALENV_SETUP=vendor/virtualenv/virtualenv.py
VIRTUALENV_TARGET_DIR=python
VIRTUALENV_ACTIVATE=$VIRTUALENV_TARGET_DIR/bin/activate
DEV_NULL=/dev/stdout
if [ ! -e $VIRTUALENV_SETUP ]; then
echo "Not found: $VIRTUALENV_SETUP"
echo "Did you forget to 'git submodule update --init --recursive'?"
exit 1
fi
if [ ! -e $ANSIBLE_ENV_SETUP ]; then
echo "Not found: $ANSIBLE_ENV_SETUP"
echo "Did you forget to 'git submodule update --init --recursive'?"
exit 1
fi
if [[ ! -e $VIRTUALENV_ACTIVATE ]]; then
python $VIRTUALENV_SETUP $VIRTUALENV_TARGET_DIR &> $DEV_NULL
elif [ -e $VIRTUALENV_ACTIVATE ]; then
echo "Skipping virtualenv install (already exists)"
fi
source $VIRTUALENV_ACTIVATE
if [[ -z $(pip show paramiko PyYAML Jinja2 httplib2) ]]; then
if ! pip install paramiko PyYAML Jinja2 httplib2 &> $DEV_NULL; then
echo "Failed: pip install"
exit 1
fi
fi
source $ANSIBLE_ENV_SETUP &> $DEV_NULL
ansible-playbook -i inventory --ask-become-pass main.yml
# We don's want to be in pip to install global pip modules
deactivate
ansible-playbook -i inventory --ask-become-pass common.yml
trap - EXIT