-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeploy
executable file
·46 lines (36 loc) · 1.06 KB
/
deploy
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
#!/bin/sh
root="apps.ocp-c1.prod.psi.redhat.com"
project="front-door-ci"
instance="${1:-q6temveyoz}"
set -eu
yml="cockpit-cloud-${instance}.yml"
test ! -e "${yml}"
# container/build quay.io/lis/cockpit-cloud
if ! test -d ephemeral-keys; then
echo " GEN ephemeral-keys"
./make-keys "$root"
fi
echo " GEN ${yml}"
sed \
-e "s,@PROJECT@,$project," \
-e "s,@INSTANCE@,$instance," \
-e "s,@SERVER_KEY@,$(base64 -w0 ephemeral-keys/server.key)," \
-e "s,@SERVER_CRT@,$(base64 -w0 ephemeral-keys/server.crt)," \
-e "s,@CLIENT_CRT@,$(base64 -w0 ephemeral-keys/client.crt)," \
cockpit-cloud.yml.in > "${yml}"
echo " CREATE ${yml}"
oc create -f "${yml}"
echo " GEN client/start"
sed \
-e "s,@ROOT@,$root," \
-e "s,@PROJECT@,$project," \
-e "s,@INSTANCE@,$instance," \
start.in > client/start
chmod +x client/start
echo " TAR client.tar.xz"
tar cJvfh client.tar.xz client
echo
echo " https://cockpit-cloud-${instance}-${project}.${root}/"
echo
echo " ssh c tar xJv < client.tar.xz"
echo " ssh c client/start"