forked from sa-ne/openshift-github-actions
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (73 loc) · 3.11 KB
/
Copy pathdeploy-acm.yml
File metadata and controls
89 lines (73 loc) · 3.11 KB
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
name: deploy-acm
on:
workflow_dispatch:
inputs:
ocpAPI:
description: 'OpenShift API endpoint (eg. https://api.ocp-15.sandbox1900.opentlc.com:6443)'
required: true
jobs:
deploy-acm:
runs-on: macos-latest
env:
lcl_install_dir: windows-node-deployment-${{ github.run_number }}
steps:
- name: "Checkout ${{ github.ref }}"
uses: actions/checkout@master
with:
ref: ${{ github.ref }}
- name: Install OpenShift CLI
uses: redhat-actions/oc-installer@v1
- name: Authenticate with OpenShift
uses: redhat-actions/oc-login@v1
with:
openshift_server_url: ${{ github.event.inputs.ocpAPI }}
openshift_username: ${{ secrets.OC_USER }}
openshift_password: ${{ secrets.OC_PASSWORD }}
insecure_skip_tls_verify: true
- name: Install ACM Operator
shell: bash
run: |
oc apply -f ./crd/acm/acm-namespace.yaml
oc apply -f ./crd/acm/acm-og.yaml
oc apply -f ./crd/acm/acm-sub.yaml
sleep 60
oc project openshift-advanced-cluster-mgmt
TIMEOUT=0
acm_subs_status=$(oc get csv -n openshift-advanced-cluster-mgmt -o jsonpath='{.items[0].status.phase}')
while [ "$acm_subs_status" != "Succeeded" ]; do
echo "ACM operator still being deployed. Waiting one more minute..."
sleep 60
if [ $TIMEOUT -gt 15 ]; then #15 MINUTES TIMEOUT
echo "Timeout reached... Check the status of ACM deployment on OpenShift."
exit 1
fi
TIMEOUT=$(($TIMEOUT+1))
acm_subs_status=$(oc get csv -n openshift-advanced-cluster-mgmt -o jsonpath='{.items[0].status.phase}')
done
echo "ACM Operator Deployment Finished"
- name: Creating Pull-secret on ACM namespace
shell: bash
run: |
echo '${{ secrets.PULL_SECRET }}' > pull-secret.txt
oc create secret generic acm-pullsecret -n openshift-advanced-cluster-mgmt --from-file=.dockerconfigjson=pull-secret.txt --type=kubernetes.io/dockerconfigjson -n openshift-advanced-cluster-mgmt
- name: Deploy MultiClusterHub
shell: bash
run: |
oc apply -f ./crd/acm/acm-mch.yml
sleep 120 # WAITING 2 MINUTES FOR MCH DEPLOYMENT
- name: Verify ACM status
shell: bash
run: |
TIMEOUT=0
mch_status=$(oc get MultiClusterHub multiclusterhub -n openshift-advanced-cluster-mgmt -o jsonpath='{.status.phase}')
while [ "$mch_status" != "Running" ]; do
echo "MultiClusterHub still being deployed. Waiting one more minute..."
sleep 60
if [ $TIMEOUT -gt 15 ]; then #15 MINUTES TIMEOUT
echo "Timeout reached... Check the status of ACM deployment on OpenShift."
exit 1
fi
TIMEOUT=$(($TIMEOUT+1))
mch_status=$(oc get MultiClusterHub multiclusterhub -n openshift-advanced-cluster-mgmt -o jsonpath='{.status.phase}')
done
echo "ACM Deployment Finished"