Skip to content

Commit

Permalink
Merge pull request #59 from bcgov/release/3.4.0
Browse files Browse the repository at this point in the history
Release/3.4.0
  • Loading branch information
dpitk2222 authored Oct 2, 2024
2 parents 3336a51 + f098f1d commit cdf9436
Show file tree
Hide file tree
Showing 451 changed files with 45,004 additions and 4,052 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ jobs:
with:
ENVIRONMENT: DEV
MICROSERVICE_NAME: cirras-underwriting-war
DOWNLOAD_FILE: cirras-underwriting-api-3.2.0.tgz
DOWNLOAD_FILE: cirras-underwriting-api-3.4.0.tgz
DOWNLOAD_PATH: cirras-underwriting-war/cirras-underwriting-war/src/main/angular/
20 changes: 15 additions & 5 deletions .github/workflows/build-reports.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build reports
name: build and deploy reports

on:
workflow_dispatch:
Expand All @@ -13,6 +13,13 @@ on:
- dlvr
- test
- prod
NAMESPACE:
required: true
type: choice
options:
- a12541-dev
- a12541-test
- a12541-prod

jobs:
build:
Expand All @@ -31,19 +38,22 @@ jobs:
with:
files: cirras-underwriting-reports-jrs/**/*.xml
env:
CUWS_ds_0_url: "jdbc:postgresql://crunchy-postgres-pgbouncer.${{vars.LICENSE_PLATE}}-${{ inputs.ENVIRONMENT_NAME }}.svc.cluster.local/cirras${{inputs.ENVIRONMENT_NAME}}"
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: zip files
working-directory: cirras-underwriting-reports-jrs/src/main
- 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
path: cirras-underwriting-reports-jrs/src/main/export.zip
6 changes: 3 additions & 3 deletions .github/workflows/deploy-reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jobs:
- name: Make report zipfile
run: |
cd cirras-underwriting-reports-jrs/src/main
zip export.zip ./*
export AUTHORIZATION="Basic $(echo ${{vars.JASPER_USER}}:${{vars.JASPER_PASSWORD}} | base64)"
zip -qq -r export.zip .
export AUTHORIZATION="Basic $(echo -n ${{vars.JASPER_USERNAME}}:${{secrets.JASPER_PASSWORD}} | base64)"
export JASPER_URL="https://cirras-underwriting-jasper-route-${{ 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
51 changes: 50 additions & 1 deletion .github/workflows/liquibase-ddl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,60 @@ on:
default: latest

jobs:

ddl_dockerbuild:
runs-on: ubuntu-latest
environment:
name: ${{ inputs.ENVIRONMENT_NAME }}
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ vars.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta_pr
uses: docker/metadata-action@v5
with:
images: ${{ vars.REGISTRY}}/${{ github.repository_owner }}/cirras-underwriting-liquibase
tags: |
type=schedule
type=raw,value=${{ github.base_ref }}
type=ref,event=tag
type=raw,value=${{ inputs.TAG }}
${{ toJson(github.event.pull_request.number) == '{}' && format( 'type=raw,value=pr-{0}', github.event.pull_request.number) || '' }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./cirras-underwriting-liquibase
push: true
tags: ${{ steps.meta_pr.outputs.tags }}
labels: ${{ steps.meta_pr.outputs.labels }}


ddl_deploy:
needs: ddl_dockerbuild
uses: ./.github/workflows/openshift-deploy.yml
secrets: inherit
with:
MICROSERVICE_NAME: cirras-underwriting-liquibase
ENVIRONMENT: ${{ inputs.ENVIRONMENT_NAME }}
ENVIRONMENT_NAME: ${{ inputs.ENVIRONMENT_NAME }}
NAMESPACE: ${{ inputs.NAMESPACE }}
TAG: ${{ inputs.TAG }}

23 changes: 14 additions & 9 deletions .github/workflows/openshift-create-update-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@ jobs:
uses: actions/checkout@v4

- name: copy crunchydb files
run: mkdir staging && cp crunchy-postgres/charts/crunchy-postgres staging/crunchy-postgres
run: mkdir staging && cp -r crunchy-postgres/charts/crunchy-postgres staging/crunchy-postgres

- name: Fill properties files
uses: cschleiden/[email protected]
with:
files: staging/**/*
env:
ENV: ${{ inputs.ENVIRONMENT_NAME }}
DB_STORAGE: 600Mi
DB_MAX_CPU: 200m
DB_MAX_MEMORY: 384Mi
DB_REPLICAS: 2
BOUNCER_REPLICAS: 2
DB_STORAGE: ${{ vars.DB_STORAGE }}
DB_MAX_CPU: ${{ vars.DB_MAX_CPU }}
DB_MAX_MEMORY: ${{ vars.DB_MAX_MEMORY}}
DB_REPLICAS: ${{ vars.DB_INSTANCE_HA_REPLICAS }}
BOUNCER_REPLICAS: ${{ vars.DB_LOADBALANCER_HA_REPLICAS}}

- name: install helm
run: |
Expand All @@ -64,8 +64,13 @@ jobs:
- name: zip and install helm chart
run: |
cd staging && tar -czvf crunchy-postgres.tar.gz crunchy-postgres
if [[ $(helm status crunchy-postgres-${{inputs.ENVIRONMENT_NAME}}) == *"not found"* ]]; then
helm install crunchy-postgres-${{inputs.ENVIRONMENT_NAME}} .\crunchy-postgres.tar.gz
export STATUS_OUT=$(helm status crunchy-postgres-${{inputs.ENVIRONMENT_NAME}} 2>&1 >/dev/null)
if [[ $STATUS_OUT == *"not found"* ]]; then
echo "Attempting helm install"
helm install crunchy-postgres-${{inputs.ENVIRONMENT_NAME}} ./crunchy-postgres.tar.gz
exit 0
else
helm upgrade crunchy-postgres-${{inputs.ENVIRONMENT_NAME}} .\crunchy-postgres.tar.gz
echo "Attempting helm upgrade"
helm upgrade crunchy-postgres-${{inputs.ENVIRONMENT_NAME}} ./crunchy-postgres.tar.gz
exit 0
fi
53 changes: 42 additions & 11 deletions .github/workflows/openshift-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- cirras-underwriting-api
- cirras-underwriting-ui
- cirras-underwriting-jasper
- cirras-underwriting-liquibase
ENVIRONMENT_NAME:
required: true
type: choice
Expand Down Expand Up @@ -71,16 +72,24 @@ jobs:
ENV: ${{ inputs.ENVIRONMENT_NAME }}
NAMESPACE: ${{ inputs.NAMESPACE }}
TAG: ${{ inputs.TAG }}
SID: ${{ github.run_id }}
LOG_LEVEL: ${{ vars.LOG_LEVEL }}


WEBADE_CHECK_TOKEN_URL: ${{ vars.WEBADE_CHECK_TOKEN_URL }}
WEBADE_GET_TOKEN_URL: ${{ vars.WEBADE_GET_TOKEN_URL }}
POSTGRES_USERNAME: ${{ vars.POSTGRES_USERNAME}}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}


#API variables
POSTGRES_USERNAME: ${{ vars.POSTGRES_USERNAME }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
POSTGRES_MAXACTIVE: '10'
API_CPU_REQUEST: ${{ vars.API_CPU_REQUEST }}
API_CPU_LIMIT: ${{ vars.API_CPU_LIMIT }}
API_MEMORY_REQUEST: ${{ vars.API_MEMORY_REQUEST }}
API_MEMORY_LIMIT: ${{ vars.API_MEMORY_LIMIT }}
MAX_API_COUNT: ${{ vars.MAX_APP_COUNT }}

POSTGRES_RESOURCE_NAME: ${{ vars.POSTGRES_RESOURCE_NAME }}


MAX_THREADS: ${{ vars.MAX_THREADS }}
TARGET_PORT: ${{ vars.TARGET_PORT }}
Expand All @@ -89,18 +98,25 @@ jobs:
CIRRAS_POLICIES_API_URL: ${{ vars.CIRRAS_POLICIES_API_URL}}
CIRRAS_UNDERWRITING_REST_CLIENT_ID: ${{ vars.CIRRAS_UNDERWRITING_REST_CLIENT_ID }}
CIRRAS_UNDERWRITING_REST_SECRET: ${{ secrets.CIRRAS_UNDERWRITING_REST_SECRET }}

JASPER_URL: cirras-underwriting-jasper-${{ vars.LICENSE_PLATE }}-${{inputs.ENVIRONMENT_NAME}}.apps.silver.devops.gov.bc.ca
JASPER_USERNAME: ${{ vars.JASPER_USERNAME }}
JASPER_PASSWORD: ${{ secrets.JASPER_PASSWORD }}

WEBADE_USERNAME: ${{ vars.WEBADE_USERNAME }}
WEBADE_PASSWORD: ${{ secrets.WEBADE_PASSWORD }}
WEBADE_MAXACTIVE: ${{ vars.WEBADE_MAXACTIVE }}


#DB/Liquibase variables:
POSTGRES_READ_ONLY_PASSWORD: ${{ secrets.POSTGRES_READONLY_PASSWORD }}
POSTGRES_PROXY_USER_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
POSTGRES_ADMIN_USERNAME: ${{ secrets.POSTGRES_ADMIN_USERNAME }}
POSTGRES_ADMIN_PASSWORD: ${{ secrets.POSTGRES_ADMIN_PASSWORD }}
POSTGRES_MAXACTIVE: '10'
CHANGELOG_FILE: changelog.json


#Frontend variables
MAX_UI_COUNT: ${{ vars.MAX_UI_COUNT }}
BASE_URL: https://cirras-underwriting-ui-route-${{ inputs.ENVIRONMENT_NAME }}-${{inputs.NAMESPACE}}.apps.silver.devops.gov.bc.ca/pub/cirras-underwriting/
CIRRAS_UNDERWRITING_REST_URI: https://cirras-underwriting-api-${{ inputs.ENVIRONMENT_NAME }}-${{inputs.NAMESPACE}}.apps.silver.devops.gov.bc.ca/cirras-underwriting-api/v1
CIRRAS_UNDERWRITING_REST_URI: https://cirras-underwriting-api-route-${{ inputs.ENVIRONMENT_NAME }}-${{inputs.NAMESPACE}}.apps.silver.devops.gov.bc.ca/cirras-underwriting-api/v1
WEBADE_CIRRAS_UNDERWRITING_UI_SECRET: ${{secrets.WEBADE_CIRRAS_UNDERWRITING_UI_SECRET}}

ACTIVE_PORT: ${{ vars.TARGET_PORT }}
Expand All @@ -112,12 +128,27 @@ jobs:
WEBADE_OAUTH2_SCOPES: ${{ vars.WEBADE_OAUTH2_SCOPES }}

WEB_PATH: ${{ vars.WEB_PATH }}


#Jasper variables
JASPER_URL: https://cirras-underwriting-jasper-${{ inputs.ENVIRONMENT_NAME }}-${{ inputs.NAMESPACE }}.apps.silver.devops.gov.bc.ca/jasperserver/
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}}
openshift_server_url: ${{secrets.OPENSHIFT_SERVER_URL}}
openshift_token: ${{secrets.OPENSHIFT_TOKEN}}
namespace: ${{ inputs.NAMESPACE }}

- name: Apply .yaml files to openshift
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
.vscode
**/.git.bak
compose.yaml
local-config
local-config
cirras-underwriting-api/cirras-underwriting-api-rest-endpoints/src/test/resources/static.properties
cirras-underwriting-api/cirras-underwriting-persistence/src/test/resources/static.properties
cirras-underwriting-war/cirras-underwriting-war/src/main/angular/package-lock.json
4 changes: 2 additions & 2 deletions cirras-underwriting-api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM tomcat:9.0.86-jre17

COPY ./cirras-underwriting-api-rest-endpoints/target/cirras-underwriting-api-rest-endpoints-3.2.0-SNAPSHOT.war .
COPY ./cirras-underwriting-api-rest-endpoints/target/cirras-underwriting-api-rest-endpoints-3.4.0.war .
COPY ./deploy-tools ./deploy-tools

RUN ls
Expand Down Expand Up @@ -30,4 +30,4 @@ RUN rm -rf /usr/local/tomcat/webapps/ROOT &&\
USER tomcat

EXPOSE 8005 8080
CMD ["catalina.sh", "run"]
CMD ["catalina.sh", "run"]
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>ca.bc.gov.mal.cirras.underwriting</groupId>
<artifactId>cirras-underwriting-api-parent</artifactId>
<version>3.2.0-SNAPSHOT</version>
<version>3.4.0</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>ca.bc.gov.mal.cirras.underwriting</groupId>
<artifactId>cirras-underwriting-api-parent</artifactId>
<version>3.2.0-SNAPSHOT</version>
<version>3.4.0</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>ca.bc.gov.mal.cirras.underwriting</groupId>
<artifactId>cirras-underwriting-api-parent</artifactId>
<version>3.2.0-SNAPSHOT</version>
<version>3.4.0</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@
<parent>
<groupId>ca.bc.gov.mal.cirras.underwriting</groupId>
<artifactId>cirras-underwriting-api-parent</artifactId>
<version>3.2.0-SNAPSHOT</version>
<version>3.4.0</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<cirras.datasource.url>jdbc:postgresql://pgsql01.vividsolutions.com:5432/cirras_dev</cirras.datasource.url>
<cirras.datasource.username>proxy_cuws_rest</cirras.datasource.username>
<cirras.datasource.password>password</cirras.datasource.password>


<!-- Not needed
<cirras.datasource.url></cirras.datasource.url>
<cirras.datasource.username></cirras.datasource.username>
<cirras.datasource.password></cirras.datasource.password>
-->
</properties>
<dependencies>

Expand Down Expand Up @@ -68,6 +69,7 @@
<dependency>
<groupId>com.oracle.weblogic</groupId>
<artifactId>ojdbc7</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public interface DopYieldContractReportEndpoint extends BaseEndpoints {
@Produces({ MediaType.WILDCARD })
Response generateDopReport(
@Parameter(description = "Filter the results by the year") @QueryParam("cropYear") String cropYear,
@Parameter(description = "Filter the results by the insurance plan") @QueryParam("insurancePlanId") String insurancePlanId,
@Parameter(description = "Filter the results by the insurance plan", required = true) @QueryParam("insurancePlanId") String insurancePlanId,
@Parameter(description = "Filter the results by the office") @QueryParam("officeId") String officeId,
@Parameter(description = "Filter the results by the policy status") @QueryParam("policyStatusCode") String policyStatusCode,
@Parameter(description = "Filter the results by the policy number") @QueryParam("policyNumber") String policyNumber,
Expand Down
Loading

0 comments on commit cdf9436

Please sign in to comment.