forked from openshift-kni/baremetal-deploy
-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathdeploy.sh
executable file
·50 lines (36 loc) · 1.64 KB
/
deploy.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
#!/usr/bin/env bash
set -uo pipefail
BASEDIR="$(dirname "$0")"
PTP_DEPLOYMENT=${BASEDIR}/deploy
# shellcheck disable=SC1091,SC1090
. "${BASEDIR}/../lib/functions.sh"
[ -f "${BASEDIR}/myvars" ] || die "A 'myvars' file needs to be created, see the README"
# shellcheck disable=SC1091,SC1090
. "${BASEDIR}/myvars"
deploy(){
pushd "${PTP_DEPLOYMENT}" || die "pushd to ${PTP_DEPLOYMENT} failed"
oc apply -f 01_namespace.yaml
oc apply -f 02_operator_group.yaml
export channel=`oc get packagemanifest ptp-operator -n openshift-marketplace -o jsonpath='{.status.channels[].name}'`
if [[ ${channel} == "" ]]; then
die "failed to find ptp-operator channel"
fi
envsubst < 03_subscription.yaml | oc apply -f -
while [[ `oc -n openshift-ptp get csv --no-headers | wc -l` != "1" ]]; do
sleep 2
done
until oc -n openshift-ptp get csv -o yaml | sed "s,image-registry.openshift-image-registry.svc:5000/openshift/ose-ptp-operator@.*,${ptp_operator}:${channel},g" | sed "s,image-registry.openshift-image-registry.svc:5000/openshift/ose-ptp@.*,${ptp_daemon}:${channel},g" | oc apply -f -
do
echo "failed to update csv images"
done
until oc -n openshift-ptp get deploy -o yaml | sed "s,image-registry.openshift-image-registry.svc:5000/openshift/ose-ptp-operator@.*,${ptp_operator}:${channel},g" | sed "s,image-registry.openshift-image-registry.svc:5000/openshift/ose-ptp@.*,${ptp_daemon}:${channel},g" | oc apply -f -
do
echo "failed to update deployment images"
done
while [[ `oc -n openshift-ptp get csv --no-headers | grep Succeeded | wc -l` != "1" ]]; do
sleep 2
done
popd || die "popd failed"
}
ocp_sanity_check
deploy