blob: b2befd3d90ddc2a970bc2bfcaae296d37381e01f (
plain)
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
|
if [ ! -e /home/%{applicationId} ]; then useradd -m -s /bin/bash %{applicationId}; fi
OUT=/tmp/`basename %{url}`
case '%{userName}:%{password}' in
null:null)
curl -s -k -f -o \$OUT %{url}
;;
*)
curl -s -k -f --user '%{userName}:%{password}' -o \$OUT %{url}
;;
esac
case %{type} in
deb)
dpkg --install \$OUT
;;
jar)
mkdir -p /opt/app/%{artifactId}/lib
mv \$OUT /opt/app/%{artifactId}/lib
chown -R %{applicationId}:%{applicationId} /opt/app/%{artifactId}
;;
zip)
mkdir -p /opt/app/%{artifactId}/lib
( cd /opt/app/%{artifactId} ; cp -p \$OUT . ; unzip -o \$OUT )
chown -R %{applicationId}:%{applicationId} /opt/app/%{artifactId}
;;
esac
|