generated from bcgov/bcrs-template-ui
-
Notifications
You must be signed in to change notification settings - Fork 14
119 lines (101 loc) · 5.08 KB
/
restart-services.yaml
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Restart Services
on:
schedule:
# At 1:30am (PST) every day.
- cron: "30 9 * * *"
workflow_dispatch:
inputs:
environement:
description: "Environment (dev/test/prod)"
required: true
default: "prod"
jobs:
restart-services:
runs-on: ubuntu-22.04
environment: ${{ github.event.inputs.environment }}
steps:
- uses: actions/checkout@v4
- name: Set env by input
run: |
echo "TAG_NAME=${{ github.event.inputs.environement }}" >> $GITHUB_ENV
- name: Set env
if: env.TAG_NAME == ''
run: |
echo "TAG_NAME=prod" >> $GITHUB_ENV
- name: Login Openshift
run: |
oc login --server=${{secrets.OPENSHIFT4_LOGIN_REGISTRY}} --token=${{secrets.OPENSHIFT4_SA_TOKEN}}
- name: Restart PPR Report API
run: |
report_pods=`oc get pods --selector=name=report-api -o name -n 1dfe78-${{ env.TAG_NAME }} | sed "s/^.\{4\}//"`
for i in $report_pods;
do
oc delete pod $i -n 1dfe78-${{ env.TAG_NAME }}
sleep 1m
done
- name: Restart Report API
run: |
report_pods=`oc get pods --selector=name=report-api -o name -n d893f6-${{ env.TAG_NAME }} | sed "s/^.\{4\}//"`
for i in $report_pods;
do
oc delete pod $i -n d893f6-${{ env.TAG_NAME }}
sleep 1m
done
- name: Restart nats-streaming
run: |
oc scale --replicas=0 dc/nats-streaming-${{ env.TAG_NAME }} -n d893f6-${{ env.TAG_NAME }}
oc scale --replicas=1 dc/nats-streaming-${{ env.TAG_NAME }} -n d893f6-${{ env.TAG_NAME }}
oc rollout status dc/nats-streaming-${{ env.TAG_NAME }} -n d893f6-${{ env.TAG_NAME }} -w
sleep 10m
#- name: Restart namex-pay
# run: |
# oc scale --replicas=0 dc/namex-pay-${{ env.TAG_NAME }} -n f2b77c-${{ env.TAG_NAME }}
# oc scale --replicas=1 dc/namex-pay-${{ env.TAG_NAME }} -n f2b77c-${{ env.TAG_NAME }}
#- name: Restart entity-pay
# run: |
# oc scale --replicas=0 dc/entity-pay-${{ env.TAG_NAME }} -n cc892f-${{ env.TAG_NAME }}
# oc scale --replicas=1 dc/entity-pay-${{ env.TAG_NAME }} -n cc892f-${{ env.TAG_NAME }}
- name: Restart entity-filer
run: |
oc scale --replicas=0 dc/entity-filer-${{ env.TAG_NAME }} -n cc892f-${{ env.TAG_NAME }}
oc scale --replicas=1 dc/entity-filer-${{ env.TAG_NAME }} -n cc892f-${{ env.TAG_NAME }}
- name: Restart entity-emailer
run: |
oc scale --replicas=0 dc/entity-emailer-${{ env.TAG_NAME }} -n cc892f-${{ env.TAG_NAME }}
oc scale --replicas=1 dc/entity-emailer-${{ env.TAG_NAME }} -n cc892f-${{ env.TAG_NAME }}
#- name: Restart payment-reconciliations
# run: |
# oc scale --replicas=0 dc/payment-reconciliations-${{ env.TAG_NAME }} -n 78c88a-${{ env.TAG_NAME }}
# oc scale --replicas=1 dc/payment-reconciliations-${{ env.TAG_NAME }} -n 78c88a-${{ env.TAG_NAME }}
#- name: Restart events-listener (pay)
# run: |
# oc scale --replicas=0 dc/events-listener-${{ env.TAG_NAME }} -n 78c88a-${{ env.TAG_NAME }}
# oc scale --replicas=1 dc/events-listener-${{ env.TAG_NAME }} -n 78c88a-${{ env.TAG_NAME }}
#- name: Restart account-mailer
# run: |
# oc scale --replicas=0 dc/account-mailer-${{ env.TAG_NAME }} -n 6e0e49-${{ env.TAG_NAME }}
# oc scale --replicas=1 dc/account-mailer-${{ env.TAG_NAME }} -n 6e0e49-${{ env.TAG_NAME }}
#- name: Restart activity-log-listener
# run: |
# oc scale --replicas=0 dc/activity-log-listener-${{ env.TAG_NAME }} -n 6e0e49-${{ env.TAG_NAME }}
# oc scale --replicas=1 dc/activity-log-listener-${{ env.TAG_NAME }} -n 6e0e49-${{ env.TAG_NAME }}
#- name: Restart names-events-listener
# run: |
# oc scale --replicas=0 dc/names-events-listener-${{ env.TAG_NAME }} -n 6e0e49-${{ env.TAG_NAME }}
# oc scale --replicas=1 dc/names-events-listener-${{ env.TAG_NAME }} -n 6e0e49-${{ env.TAG_NAME }}
#- name: Restart events-listener (auth)
# run: |
# oc scale --replicas=0 dc/events-listener-${{ env.TAG_NAME }} -n 6e0e49-${{ env.TAG_NAME }}
# oc scale --replicas=1 dc/events-listener-${{ env.TAG_NAME }} -n 6e0e49-${{ env.TAG_NAME }}
- name: Restart search-solr-updater
run: |
oc scale --replicas=0 dc/search-solr-updater-${{ env.TAG_NAME }} -n 6e0e49-${{ env.TAG_NAME }}
oc scale --replicas=1 dc/search-solr-updater-${{ env.TAG_NAME }} -n 6e0e49-${{ env.TAG_NAME }}
- name: Restart solr-names-updater
run: |
oc scale --replicas=0 dc/solr-names-updater-${{ env.TAG_NAME }} -n f2b77c-${{ env.TAG_NAME }}
oc scale --replicas=1 dc/solr-names-updater-${{ env.TAG_NAME }} -n f2b77c-${{ env.TAG_NAME }}
- name: Restart bor-solr-updater
run: |
oc scale --replicas=0 dc/bor-solr-updater-${{ env.TAG_NAME }} -n 1dfe78-${{ env.TAG_NAME }}
oc scale --replicas=1 dc/bor-solr-updater-${{ env.TAG_NAME }} -n 1dfe78-${{ env.TAG_NAME }}