build and deploy reports #33
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: build and deploy reports | |
on: | |
workflow_dispatch: | |
inputs: | |
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 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: | |
name: ${{ inputs.ENVIRONMENT_NAME }} | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Fill xml files | |
uses: cschleiden/[email protected] | |
with: | |
files: cirras-underwriting-reports-jrs/**/*.xml | |
env: | |
CUWS_ds_0_url: "jdbc:postgresql://crunchy-postgres-${{inputs.ENVIRONMENT_NAME}}-pgbouncer.${{inputs.NAMESPACE}}.svc.cluster.local/cirras${{inputs.ENVIRONMENT_NAME}}" | |
CUWS_ds_0_user: "${{ secrets.POSTGRES_READONLY_USERNAME }}" | |
CUWS_ds_0_password: "${{ secrets.POSTGRES_READONLY_PASSWORD }}" | |
- name: Install zip | |
uses: montudor/action-zip@v1 | |
- name: Make report zipfile | |
run: | | |
cd cirras-underwriting-reports-jrs/src/main | |
zip -qq -r export.zip . | |
export AUTHORIZATION="Basic $(echo -n ${{vars.JASPER_USERNAME}}:${{secrets.JASPER_PASSWORD}} | base64)" | |
export JASPER_URL="https://cirras-underwriting-jasper-${{ inputs.ENVIRONMENT_NAME}}-${{ inputs.NAMESPACE}}.apps.silver.devops.gov.bc.ca/jasperserver/rest_v2/import?keyAlias=deprecatedImportExportEncSecret&update=true" | |
curl -X POST $JASPER_URL -H "Content-Type: application/zip" -H "Authorization: $AUTHORIZATION" -T export.zip | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: export.zip | |
path: cirras-underwriting-reports-jrs/src/main/export.zip |