-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (45 loc) · 1.52 KB
/
ci-migrations-prod.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
name: Run Migrations (Prod)
on:
workflow_dispatch:
env:
CLUSTER: https://api.gold.devops.gov.bc.ca:6443
AUTH_TOKEN: ${{ secrets.OC_AUTH_TOKEN }}
TOOLS_TOKEN: ${{ secrets.OC_TOOLS_TOKEN }}
PROJECT: tcloud
jobs:
run_migrations:
name: Run Migrations (Prod)
environment: prod
runs-on: ubuntu-latest
timeout-minutes: 20
env:
OS_NAMESPACE_SUFFIX: prod
AUTH_TOKEN: ${{ secrets.OC_AUTH_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup ENV file
run: cp .env.example .env
- name: Cache OpenShift CLI
id: cache-oc
uses: actions/cache@v2
with:
path: /usr/local/bin/oc
key: ${{ runner.os }}-oc
- name: Install OpenShift CLI
if: steps.cache-oc.outputs.cache-hit != 'true'
run: |
OC_VERSION=3.11.0
sudo apt-get update
sudo apt-get -y install wget
wget --quiet -O oc.tar.gz "https://github.com/openshift/origin/releases/download/v${OC_VERSION}/openshift-origin-client-tools-v${OC_VERSION}-0cbc58b-linux-64bit.tar.gz"
FILE=$(tar -tf oc.tar.gz | grep '/oc$')
tar -zxf oc.tar.gz "$FILE"
sudo mv "$FILE" /usr/local/bin/oc
rm -rf oc.tar.gz openshift-origin-client-tools-v*
- name: Run migrations
run: |
cd "$GITHUB_WORKSPACE"
oc login --token="${{ env.AUTH_TOKEN }}" --server="$CLUSTER"
export OS_NAMESPACE_SUFFIX=${{ env.OS_NAMESPACE_SUFFIX }}
make migration-run-oc