Restart Services #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-20.04 | |
environment: ${{ github.event.inputs.environment }} | |
steps: | |
- uses: actions/checkout@v3 | |
- 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 business-events-listener | |
run: | | |
oc scale --replicas=0 dc/business-events-listener-${{ env.TAG_NAME }} -n 6e0e49-${{ env.TAG_NAME }} | |
oc scale --replicas=1 dc/business-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 }} |