Run Migrations (Prod) #1
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: 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 |