Skip to content

openshift jasper deploy #6

openshift jasper deploy

openshift jasper deploy #6

name: openshift jasper deploy
on:
workflow_dispatch:
inputs:
MICROSERVICE_NAME:
required: true
type: choice
options:
- cirras-underwriting-jasper
ENVIRONMENT_NAME:
required: true
type: choice
options:
- dev
- qa
- int
- dlvr
- test
- prod
NAMESPACE:
required: true
type: choice
options:
- a12541-dev
- a12541-test
- a12541-prod
workflow_call:
inputs:
MICROSERVICE_NAME:
required: true
type: string
ENVIRONMENT_NAME:
required: true
type: string
NAMESPACE:
required: true
type: string
jobs:
build:
runs-on: ubuntu-latest
environment:
name: ${{ inputs.ENVIRONMENT_NAME }}
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Copy openshift yaml files
run: mkdir staging && cp openshift/${{ inputs.MICROSERVICE_NAME }}*.yaml staging/
- name: Fill yaml files
uses: cschleiden/[email protected]
with:
files: staging/**.yaml
env:
#Common variables
ENV: ${{ inputs.ENVIRONMENT_NAME }}
NAMESPACE: ${{ inputs.NAMESPACE }}
#Jasper variables
JASPER_URL: cirras-underwriting-jasper-${{ inputs.ENVIRONMENT_NAME }}-${{inputs.NAMESPACE}}.apps.silver.devops.gov.bc.ca
JASPER_USERNAME: ${{ vars.JASPER_USERNAME }}
JASPER_PASSWORD: ${{ secrets.JASPER_PASSWORD }}
ALLOW_EMPTY_PASSWORD: true
JASPERREPORTS_DATABASE_NAME: jasper${{ inputs.ENVIRONMENT_NAME }}
JASPERREPORTS_DATABASE_USER: ${{ secrets.JASPER_DATABASE_USER }}
JASPERREPORTS_DATABASE_PASSWORD: ${{ secrets.JASPER_DATABASE_PASSWORD }}
JASPERREPORTS_UI_USER: ${{ vars.JASPER_USERNAME }}
JASPERREPORTS_UI_PASSWORD: ${{ secrets.JASPER_PASSWORD }}
JASPER_STORAGE_CAPACITY: 25Mi
- name: Authenticate and set context
uses: redhat-actions/oc-login@v1
with:
openshift_server_url: ${{secrets.openshift_server_url}}
openshift_token: ${{secrets.openshift_token}}
namespace: ${{ inputs.NAMESPACE }}
- name: Apply .yaml files to openshift
run: |
for file in staging/*
do
oc apply -f "$file"
done