Prmoting app manually #17
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
# Configuring target env | |
name: Prmoting app manually | |
on: | |
workflow_dispatch: | |
inputs: | |
oc_env_suffix: | |
description: The Env suffic of oc name space | |
required: true | |
type: choice | |
options: | |
- dev | |
- test | |
- production | |
env: | |
CLUSTER: https://api.silver.devops.gov.bc.ca:6443 | |
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN_OCP4 }} | |
BUILD_REF: ${{ github.base_ref }} | |
ENV_PREFIX: ${{ inputs.oc_env_suffix }} | |
NAMESPACE_DEV: ${{ vars.NAMESPACE_DEV }} | |
NAMESPACE_TEST: ${{ vars.NAMESPACE_TEST }} | |
NAMESPACE_PROD: ${{ vars.NAMESPACE_PROD }} | |
SOAM_CLIENT_ID_DEV: ${{ vars.SOAM_CLIENT_ID_DEV }} | |
SOAM_CLIENT_SECRET_DEV: ${{ secrets.SOAM_CLIENT_SECRET_DEV }} | |
SOAM_CLIENT_ID_TEST: ${{ vars.SOAM_CLIENT_ID_TEST }} | |
SOAM_CLIENT_SECRET_TEST: ${{ secrets.SOAM_CLIENT_SECRET_TEST }} | |
SOAM_CLIENT_ID_PROD: ${{ vars.SOAM_CLIENT_ID_PROD }} | |
SOAM_CLIENT_SECRET_PROD: ${{ secrets.SOAM_CLIENT_SECRET_PROD }} | |
jobs: | |
api: | |
name: Openshift Promote app | |
runs-on: ubuntu-latest | |
concurrency: ci-config-${{ inputs.oc_env_suffix }} | |
timeout-minutes: 20 | |
environment: | |
name: ${{ inputs.oc_env_suffix }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup Dynamic env vars | |
working-directory: './tools' | |
run: | | |
echo "PUBLIC_HOST=$(make get-ui-url)" >> $GITHUB_ENV | |
echo "OC_NAMESPACE=$(make get-oc-namespace)" >> $GITHUB_ENV | |
- name: Tag build and deploy application | |
working-directory: './tools' | |
run: | | |
oc login --token="$AUTH_TOKEN" --server="$CLUSTER" | |
echo Env prefix: $ENV_PREFIX | |
make print-status | |
make init-api-sec | |
make init-api-config | |
make promote-api | |
make deploy-api | |
make init-web | |
make promote-web | |
make deploy-web | |
- name: Create Route | |
working-directory: './tools' | |
run: | | |
oc login --token="$AUTH_TOKEN" --server="$CLUSTER" | |
echo Creating route with ${{ env.PUBLIC_HOST }} | |
oc --namespace=${{ env.OC_NAMESPACE }} process -f openshift/public-route.yml \ | |
-p NAME=web-ecc-iosas \ | |
-p PUBLIC_HOST=${{ env.PUBLIC_HOST }} \ | |
-p CERTIFICATE="${{ secrets.CERT }}" \ | |
-p CA_CERT="${{ secrets.CA_CERT }}" \ | |
-p PRIVATE_KEY="${{ secrets.PRIV_KEY }}" | oc --namespace=${{ env.OC_NAMESPACE }} apply -f - |