-
Notifications
You must be signed in to change notification settings - Fork 2
/
getwarped.sh
executable file
·75 lines (56 loc) · 1.39 KB
/
getwarped.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
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/sh
if [ x"$WARPDRIVE_DEBUG" != x"" ]; then
set -x
env
fi
set -eo pipefail
APP_ROOT=/opt/app-root
VERSION=0
while [ "$#" != "0" ]; do
case "$1" in
--version=*)
VERSION=`echo $1 | sed -e 's/--version=//'`
;;
--version)
VERSION=$2
shift
;;
--app-root=*)
APP_ROOT=`echo $1 | sed -e 's/--app-root=//'`
;;
--app-root)
APP_ROOT=$2
shift
;;
esac
shift
done
case "$VERSION" in
0)
VERSION=0.34.0
;;
esac
PACKAGE=https://codeload.github.com/GrahamDumpleton/warpdrive/tar.gz/$VERSION
curl -SL --fail -o /tmp/warpdrive.tar.gz $PACKAGE \
&& tar -xC $APP_ROOT --strip-components=1 -f /tmp/warpdrive.tar.gz \
warpdrive-$VERSION/warpdrive warpdrive-$VERSION/s2i \
&& rm -f /tmp/warpdrive.tar.gz
mkdir -p $APP_ROOT/bin
mkdir -p $APP_ROOT/tmp
mkdir -p $APP_ROOT/data
cat >> $APP_ROOT/bin/warpdrive << !
#!/bin/sh
exec $APP_ROOT/warpdrive/bin/warpdrive "\$@"
!
chmod +x $APP_ROOT/bin/warpdrive
PIP_DISABLE_PIP_VERSION_CHECK=1
export PIP_DISABLE_PIP_VERSION_CHECK
PIP_NO_CACHE_DIR=off
export PIP_NO_CACHE_DIR
virtualenv $APP_ROOT
PATH="$APP_ROOT/bin:$PATH"
pip install -U pip
warpdrive fixup $APP_ROOT
if [ -f $APP_ROOT/etc/scl_enable ]; then
echo ". $APP_ROOT/warpdrive/etc/shell-init" >> $APP_ROOT/etc/scl_enable
fi