-
Notifications
You must be signed in to change notification settings - Fork 0
/
cf_cid_callback.sh
123 lines (114 loc) · 2.75 KB
/
cf_cid_callback.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/bin/bash
DEPLOY_USER=futoin
if [ "$(id -un)" != "${DEPLOY_USER}" ]; then
echo "Must be called through 'sudo -u ${DEPLOY_USER}'"
exit 1
fi
TOOL_WHITELIST=""
TOOL_WHITELIST+=" ant"
TOOL_WHITELIST+=" archiva"
TOOL_WHITELIST+=" artifactory"
TOOL_WHITELIST+=" bash"
TOOL_WHITELIST+=" binutils"
TOOL_WHITELIST+=" bower"
TOOL_WHITELIST+=" bundler"
TOOL_WHITELIST+=" bzip2"
TOOL_WHITELIST+=" cargo"
TOOL_WHITELIST+=" cid"
TOOL_WHITELIST+=" cmake"
TOOL_WHITELIST+=" composer"
TOOL_WHITELIST+=" curl"
TOOL_WHITELIST+=" docker"
TOOL_WHITELIST+=" dockercompose"
TOOL_WHITELIST+=" erlang"
TOOL_WHITELIST+=" elixir"
TOOL_WHITELIST+=" exe"
TOOL_WHITELIST+=" flyway"
TOOL_WHITELIST+=" futoin"
TOOL_WHITELIST+=" gcc"
TOOL_WHITELIST+=" gem"
TOOL_WHITELIST+=" git"
TOOL_WHITELIST+=" go"
TOOL_WHITELIST+=" gpg"
TOOL_WHITELIST+=" gradle"
TOOL_WHITELIST+=" grunt"
TOOL_WHITELIST+=" gulp"
TOOL_WHITELIST+=" gvm"
TOOL_WHITELIST+=" gzip"
TOOL_WHITELIST+=" hg"
TOOL_WHITELIST+=" java"
TOOL_WHITELIST+=" jdk"
TOOL_WHITELIST+=" jfrog"
TOOL_WHITELIST+=" liquibase"
TOOL_WHITELIST+=" make"
TOOL_WHITELIST+=" maven"
TOOL_WHITELIST+=" nexus"
TOOL_WHITELIST+=" nexus3"
TOOL_WHITELIST+=" nginx"
TOOL_WHITELIST+=" node"
TOOL_WHITELIST+=" npm"
TOOL_WHITELIST+=" nvm"
TOOL_WHITELIST+=" php"
TOOL_WHITELIST+=" phpbuild"
TOOL_WHITELIST+=" phpfpm"
# It must be updated inside virtualenv
#TOOL_WHITELIST+=" pip"
TOOL_WHITELIST+=" phoenix"
TOOL_WHITELIST+=" puma"
TOOL_WHITELIST+=" puppet"
TOOL_WHITELIST+=" python"
TOOL_WHITELIST+=" ruby"
TOOL_WHITELIST+=" rust"
TOOL_WHITELIST+=" rustup"
TOOL_WHITELIST+=" rvm"
TOOL_WHITELIST+=" sbt"
TOOL_WHITELIST+=" scala"
TOOL_WHITELIST+=" scp"
TOOL_WHITELIST+=" sdkman"
TOOL_WHITELIST+=" setuptools"
TOOL_WHITELIST+=" ssh"
TOOL_WHITELIST+=" svn"
TOOL_WHITELIST+=" tar"
TOOL_WHITELIST+=" twine"
TOOL_WHITELIST+=" unzip"
TOOL_WHITELIST+=" uwsgi"
TOOL_WHITELIST+=" virtualenv"
TOOL_WHITELIST+=" webpack"
TOOL_WHITELIST+=" xz"
TOOL_WHITELIST+=" yarn"
TOOL_WHITELIST+=" zip"
TOOL_WHITELIST+=" "
cmd=$1
cd /
export CID_DEPLOY_HOME=/www/tools
umask 0022
case $cmd in
tool)
subcmd=$2
tool=$3
ver=$4
case $subcmd in
install|update)
if echo $TOOL_WHITELIST | grep -q "$tool"; then
cid tool $subcmd $tool $ver
else
echo "Tool $tool is not whitelisted yet"
fi
if [ "$tool" = "flyway" ]; then
chmod +x $CID_DEPLOY_HOME/flyway/*/flyway
fi
;;
*)
echo "Unsupported tool sub-command $subcmd" >&2
;;
esac
;;
build-dep)
shift
cid build-dep "$@"
;;
*)
echo "Unsupported command $cmd" >&2
exit 1
;;
esac