-
Notifications
You must be signed in to change notification settings - Fork 10
96 lines (81 loc) · 3.25 KB
/
uninstall_install_sandbox.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
name: Uninstall and then re-install Traction Sandbox Instance
on:
schedule:
- cron: "0 9 1,15 * *"
workflow_dispatch:
# push:
# branches:
# - main
# paths:
# - "helm-values/traction/values-sandbox.yaml"
jobs:
uninstall_sandbox:
if: (github.repository == 'bcgov/trust-over-ip-configurations') || (github.event_name == 'workflow_dispatch')
runs-on: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Run Your Job
run: |
echo "This job runs biweekly on 1st and 15th of every month at 2:00 AM PST"
- name: Authenticate and set context
uses: redhat-actions/oc-login@v1
with:
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }}
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
namespace: ${{ secrets.OPENSHIFT_NAMESPACE }}
- name: Uninstall Traction via Helm
run: |
helm uninstall traction-sandbox -n ${{ secrets.OPENSHIFT_NAMESPACE }} --wait --timeout=20m || true
- name: Remove Traction Openshift Objects
run: |
oc delete -n ${{ secrets.OPENSHIFT_NAMESPACE }} all,secret,pod,networkpolicy,configmap,pvc --selector "app.kubernetes.io/instance"=traction-sandbox
- name: Rocket.Chat Notification
uses: RocketChat/[email protected]
if: always()
with:
type: ${{ job.status }}
job_name: "*Uninstall Traction Sandbox*"
mention: "here"
mention_if: "failure"
channel: "#ditp-gha-notifications"
url: ${{ secrets.ROCKETCHAT_WEBHOOK }}
commit: true
install_sandbox:
name: Install Sandbox
if: (github.repository == 'bcgov/trust-over-ip-configurations') || (github.event_name == 'workflow_dispatch')
needs: uninstall_sandbox
runs-on: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Run Your Job
run: |
echo "This job runs biweekly on 1st and 15th of every month at 2:00 AM PST"
- name: Authenticate and set context
uses: redhat-actions/oc-login@v1
with:
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }}
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
namespace: ${{ secrets.OPENSHIFT_NAMESPACE }}
- name: Compile banner message
run: echo "BANNER_MESSAGE=$($GITHUB_WORKSPACE/src/bash/reset-sandbox-date.sh)" >> $GITHUB_ENV
- name: Install Traction via Helm
run: |
helm repo add traction https://bcgov.github.io/traction
helm upgrade --install \
-n ${{ secrets.OPENSHIFT_NAMESPACE }} --wait --timeout=7m \
-f ./helm-values/traction/values-sandbox.yaml \
--set ui.ux.infoBanner.message="${BANNER_MESSAGE}" \
traction-sandbox traction/traction
- name: Rocket.Chat Notification
uses: RocketChat/[email protected]
if: always()
with:
type: ${{ job.status }}
job_name: "*Install Traction Sandbox*"
mention: "here"
mention_if: "failure"
channel: "#ditp-gha-notifications"
url: ${{ secrets.ROCKETCHAT_WEBHOOK }}
commit: true