-
Notifications
You must be signed in to change notification settings - Fork 3
38 lines (33 loc) · 1.06 KB
/
reset-demo.yml
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
name: 'Reset Demo instances'
on:
push:
env:
OPENSHIFT_SERVER: ${{ secrets.OPENSHIFT_SERVER }}
OPENSHIFT_TOKEN: ${{ secrets.OPENSHIFT_TOKEN }}
OPENSHIFT_NAMESPACE: "pitc-okr-demo"
POD_NAME: "demo-okr-application"
jobs:
reset-demo:
runs-on: ubuntu-24.04
name: Scale down and restart demo application
steps:
- name: Install CLI tools from GitHub
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.15"
- name: Log in to OpenShift
uses: redhat-actions/oc-login@v1
with:
openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
openshift_token: ${{ env.OPENSHIFT_TOKEN }}
namespace: ${{ env.OPENSHIFT_NAMESPACE }}
- name: set pod replicas to 0 and trigger auto restart
run: |
echo "test"
oc projects
oc project
echo "${{ env.OPENSHIFT_NAMESPACE }}"
echo "${{ env.POD_NAME }}"
oc project ${{ env.OPENSHIFT_NAMESPACE }}
oc project
oc scale deployment demo-okr-application --replicas 0