-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-entrypoint.sh
42 lines (31 loc) · 1.24 KB
/
docker-entrypoint.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
#!/bin/bash
cp /etc/rundeck/id_rsa /var/lib/rundeck/.ssh/id_rsa
cp /etc/rundeck/id_rsa.pub /var/lib/rundeck/.ssh/id_rsa.pub
chown 600 /var/lib/rundeck/.ssh/id_rsa
chown 600 /var/lib/rundeck/.ssh/id_rsa.pub
#if [ ! -f /var/lib/rundeck/.ssh/id_rsa ]; then
# echo "=>Generating rundeck ssh key"
#
# mkdir -p /var/lib/rundeck/.ssh
# ssh-keygen -t rsa -b 4096 -f /var/lib/rundeck/.ssh/id_rsa -N ''
#fi
if [ ! -f /etc/rundeck/ssl/truststore ]; then
echo "=>Generating ssl cert"
keytool -keystore /etc/rundeck/ssl/keystore \
-alias rundeck -genkey -keyalg RSA -keypass adminadmin \
-storepass adminadmin -dname "cn=$HOST_RUNDECK, o=OME, c=FR"
cp /etc/rundeck/ssl/keystore /etc/rundeck/ssl/truststore
fi
echo "=>launching rundeck"
chown -R rundeck:rundeck /tmp/rundeck
chown -R rundeck:rundeck /etc/rundeck
chown -R rundeck:rundeck /var/rundeck
chown -R rundeck:rundeck /var/log/rundeck
chown -R rundeck:rundeck /var/lib/rundeck
cp /etc/rundeck/id_rsa /var/lib/rundeck/.ssh/id_rsa
cp /etc/rundeck/id_rsa.pub /var/lib/rundeck/.ssh/id_rsa.pub
chmod 600 /var/lib/rundeck/.ssh/id_rsa
chmod 600 /var/lib/rundeck/.ssh/id_rsa.pubq
cat /var/lib/rundeck/.ssh/id_rsa.pub
echo " Start Docker "
service rundeckd start && tail -f /dev/null