-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathfab
More file actions
executable file
·35 lines (30 loc) · 822 Bytes
/
fab
File metadata and controls
executable file
·35 lines (30 loc) · 822 Bytes
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
#!/usr/bin/env bash
set -e
ENV=.deployment_virtualenv
# version of fusionbox-fabric-helpers to run
HELPERS_COMMIT=978e6a1bebbf2a2e79ed01157ab202265bb1f423
HELPERS_COMMIT_FILE=$ENV/HELPERS_COMMIT
if which python2 > /dev/null 2> /dev/null
then
EXE=$(which python2)
elif python --version 2>&1 | egrep "^Python 2" > /dev/null
then
EXE=$(which python)
fi
if [ -z "$EXE" ]
then
echo "Couldn't find Python 2" > /dev/stderr
exit 127
fi
if [ ! -d $ENV ]
then
virtualenv -p "$EXE" $ENV
touch $HELPERS_COMMIT_FILE
fi
source $ENV/bin/activate
if [ "$HELPERS_COMMIT" != "$(cat $HELPERS_COMMIT_FILE)" ]
then
pip install fabric -e "git+https://github.com/fusionbox/fusionbox-fabric-helpers@$HELPERS_COMMIT#egg=fusionbox-fabric-helpers" >/dev/null
echo $HELPERS_COMMIT > $HELPERS_COMMIT_FILE
fi
exec fab "$@"