Skip to content

Commit

Permalink
Tracking pull request to merge relase-2.15.0 to master (#2828)
Browse files Browse the repository at this point in the history
* fix: resolve error saving on compliance report acceptance (#2832)

---------

Co-authored-by: Hamed Valiollahi <[email protected]>
  • Loading branch information
kuanfandevops and hamed-valiollahi authored Feb 20, 2024
1 parent e8ee15f commit 620006b
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 117 deletions.
1 change: 0 additions & 1 deletion .github/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* Create the new release branch from master
* Update tfrs-release.yaml
* name
* branches
* PR_NUMBER
* RELEASE_NAME
* Update .pipeline/lib/config.js
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/dev-release.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## For each release, the value of name, branches, RELEASE_NAME and PR_NUMBER need to be adjusted accordingly
## For each release, update lib/config.js: version and releaseBranch

name: TFRS Dev release-2.14.0
name: TFRS Dev release-2.15.0

on:
push:
branches: [ release-2.14.0 ]
branches: [ release-2.15.0 ]
paths:
- frontend/**
- backend/**
Expand All @@ -15,8 +15,8 @@ on:
env:
## The pull request number of the Tracking pull request to merge the release branch to main
## Also remember to update the version in .pipeline/lib/config.js
PR_NUMBER: 2737
RELEASE_NAME: release-2.14.0
PR_NUMBER: 2828
RELEASE_NAME: release-2.15.0

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
141 changes: 37 additions & 104 deletions .github/workflows/pr-dev-deploy-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,131 +61,64 @@ jobs:
run: |
oc tag ${{ secrets.tools-namespace }}/tfrs-frontend:build${{ inputs.suffix }} ${{ secrets.namespace }}/tfrs-frontend:dev${{ inputs.suffix }}
cd charts/tfrs-apps/charts/tfrs-frontend
helm status -n ${{ secrets.namespace }} tfrs-frontend-dev${{ inputs.suffix }}
if [ $? -eq 0 ]; then
echo "tfrs-frontend-dev${{ inputs.suffix }} release exists already"
helm upgrade \
--set frontendImageTagName=dev${{ inputs.suffix }} \
--set suffix=-dev${{ inputs.suffix }} \
--set namespace=${{ secrets.namespace }} \
--set envName=dev \
-n ${{ secrets.namespace }} -f ./values-dev-jan.yaml tfrs-frontend-dev${{ inputs.suffix }} .
else
echo "tfrs-frontend-dev${{ inputs.suffix }} release does not exist"
helm install \
--set frontendImageTagName=dev${{ inputs.suffix }} \
--set suffix=-dev${{ inputs.suffix }} \
--set namespace=${{ secrets.namespace }} \
--set envName=dev \
-n ${{ secrets.namespace }} -f ./values-dev-jan.yaml tfrs-frontend-dev${{ inputs.suffix }} .
fi
helm upgrade --install \
--set frontendImageTagName=dev${{ inputs.suffix }} \
--set suffix=-dev${{ inputs.suffix }} \
--set namespace=${{ secrets.namespace }} \
--set envName=dev \
-n ${{ secrets.namespace }} -f ./values-dev-jan.yaml tfrs-frontend-dev${{ inputs.suffix }} .
- name: Deploy tfrs-backend
shell: bash {0}
run: |
oc tag ${{ secrets.tools-namespace }}/tfrs-backend:build${{ inputs.suffix }} ${{ secrets.namespace }}/tfrs-backend:dev${{ inputs.suffix }}
cd charts/tfrs-apps/charts/tfrs-backend
helm status -n ${{ secrets.namespace }} tfrs-backend-dev${{ inputs.suffix }}
if [ $? -eq 0 ]; then
echo "tfrs-backend-dev${{ inputs.suffix }} release exists already"
helm upgrade \
--set backendImageTagName=dev${{ inputs.suffix }} \
--set suffix=-dev${{ inputs.suffix }} \
--set namespace=${{ secrets.namespace }} \
--set envName=dev \
--set databaseServiceHostName=${{ inputs.database-service-host-name }} \
--set rabbitmqVHost=tfrs-dev${{ inputs.suffix }}-vhost \
-n ${{ secrets.namespace }} -f ./values-dev-jan.yaml tfrs-backend-dev${{ inputs.suffix }} .
else
echo "tfrs-backend-dev${{ inputs.suffix }} release does not exist"
helm install \
--set backendImageTagName=dev${{ inputs.suffix }} \
--set suffix=-dev${{ inputs.suffix }} \
--set namespace=${{ secrets.namespace }} \
--set envName=dev \
--set databaseServiceHostName=${{ inputs.database-service-host-name }} \
--set rabbitmqVHost=tfrs-dev${{ inputs.suffix }}-vhost \
-n ${{ secrets.namespace }} -f ./values-dev-jan.yaml tfrs-backend-dev${{ inputs.suffix }} .
fi
helm upgrade --install \
--set backendImageTagName=dev${{ inputs.suffix }} \
--set suffix=-dev${{ inputs.suffix }} \
--set namespace=${{ secrets.namespace }} \
--set envName=dev \
--set databaseServiceHostName=${{ inputs.database-service-host-name }} \
--set rabbitmqVHost=tfrs-dev${{ inputs.suffix }}-vhost \
-n ${{ secrets.namespace }} -f ./values-dev-jan.yaml tfrs-backend-dev${{ inputs.suffix }} .
- name: Deploy tfrs-celery
shell: bash {0}
run: |
oc tag ${{ secrets.tools-namespace }}/tfrs-celery:build${{ inputs.suffix }} ${{ secrets.namespace }}/tfrs-celery:dev${{ inputs.suffix }}
cd charts/tfrs-apps/charts/tfrs-celery
helm status -n ${{ secrets.namespace }} tfrs-celery-dev${{ inputs.suffix }}
if [ $? -eq 0 ]; then
echo "tfrs-celery-dev${{ inputs.suffix }} release exists already"
helm upgrade \
--set celeryImageTagName=dev${{ inputs.suffix }} \
--set suffix=-dev${{ inputs.suffix }} \
--set namespace=${{ secrets.namespace }} \
--set envName=dev \
--set databaseServiceHostName=${{ inputs.database-service-host-name }} \
--set rabbitmqVHost=tfrs-dev${{ inputs.suffix }}-vhost \
-n ${{ secrets.namespace }} -f ./values-dev-jan.yaml tfrs-celery-dev${{ inputs.suffix }} .
else
echo "tfrs-celery-dev${{ inputs.suffix }} release does not exist"
helm install \
--set celeryImageTagName=dev${{ inputs.suffix }} \
--set suffix=-dev${{ inputs.suffix }} \
--set namespace=${{ secrets.namespace }} \
--set envName=dev \
--set databaseServiceHostName=${{ inputs.database-service-host-name }} \
--set rabbitmqVHost=tfrs-dev${{ inputs.suffix }}-vhost \
-n ${{ secrets.namespace }} -f ./values-dev-jan.yaml tfrs-celery-dev${{ inputs.suffix }} .
fi
helm upgrade --install \
--set celeryImageTagName=dev${{ inputs.suffix }} \
--set suffix=-dev${{ inputs.suffix }} \
--set namespace=${{ secrets.namespace }} \
--set envName=dev \
--set databaseServiceHostName=${{ inputs.database-service-host-name }} \
--set rabbitmqVHost=tfrs-dev${{ inputs.suffix }}-vhost \
-n ${{ secrets.namespace }} -f ./values-dev-jan.yaml tfrs-celery-dev${{ inputs.suffix }} .
- name: Deploy tfrs-scan-handler
shell: bash {0}
run: |
oc tag ${{ secrets.tools-namespace }}/tfrs-scan-handler:build${{ inputs.suffix }} ${{ secrets.namespace }}/tfrs-scan-handler:dev${{ inputs.suffix }}
cd charts/tfrs-apps/charts/tfrs-scan-handler
helm status -n ${{ secrets.namespace }} tfrs-scan-handler-dev${{ inputs.suffix }}
if [ $? -eq 0 ]; then
echo "tfrs-scan-handler-dev${{ inputs.suffix }} release exists already"
helm upgrade \
--set scanHandlerImageTagName=dev${{ inputs.suffix }} \
--set suffix=-dev${{ inputs.suffix }} \
--set namespace=${{ secrets.namespace }} \
--set envName=dev \
--set databaseServiceHostName=${{ inputs.database-service-host-name }} \
--set rabbitmqVHost=tfrs-dev${{ inputs.suffix }}-vhost \
-n ${{ secrets.namespace }} -f ./values-dev-jan.yaml tfrs-scan-handler-dev${{ inputs.suffix }} .
else
echo "tfrs-scan-handler-dev${{ inputs.suffix }} release does not exist"
helm install \
--set scanHandlerImageTagName=dev${{ inputs.suffix }} \
--set suffix=-dev${{ inputs.suffix }} \
--set namespace=${{ secrets.namespace }} \
--set envName=dev \
--set databaseServiceHostName=${{ inputs.database-service-host-name }} \
--set rabbitmqVHost=tfrs-dev${{ inputs.suffix }}-vhost \
-n ${{ secrets.namespace }} -f ./values-dev-jan.yaml tfrs-scan-handler-dev${{ inputs.suffix }} .
fi
helm upgrade --install \
--set scanHandlerImageTagName=dev${{ inputs.suffix }} \
--set suffix=-dev${{ inputs.suffix }} \
--set namespace=${{ secrets.namespace }} \
--set envName=dev \
--set databaseServiceHostName=${{ inputs.database-service-host-name }} \
--set rabbitmqVHost=tfrs-dev${{ inputs.suffix }}-vhost \
-n ${{ secrets.namespace }} -f ./values-dev-jan.yaml tfrs-scan-handler-dev${{ inputs.suffix }} .
- name: Deploy tfrs-scan-coordinator
shell: bash {0}
run: |
oc tag ${{ secrets.tools-namespace }}/tfrs-scan-coordinator:build${{ inputs.suffix}} ${{ secrets.namespace }}/tfrs-scan-coordinator:dev${{ inputs.suffix}}
cd charts/tfrs-apps/charts/tfrs-scan-coordinator
helm status -n ${{ secrets.namespace }} tfrs-scan-coordinator-dev${{ inputs.suffix }}
if [ $? -eq 0 ]; then
echo "tfrs-scan-coordinator-dev${{ inputs.suffix }} release exists already"
helm upgrade \
--set scanCoordinatorImageTagName=dev${{ inputs.suffix}} \
--set suffix=-dev${{ inputs.suffix }} \
--set namespace=${{ secrets.namespace }} \
--set envName=dev \
--set rabbitmqVHost=tfrs-dev${{ inputs.suffix }}-vhost \
-n ${{ secrets.namespace }} -f ./values-dev-jan.yaml tfrs-scan-coordinator-dev${{ inputs.suffix }} .
else
echo "tfrs-scan-coordinator${{ inputs.suffix }} release does not exist"
helm install \
--set scanCoordinatorImageTagName=dev${{ inputs.suffix}} \
--set suffix=-dev${{ inputs.suffix }} \
--set namespace=${{ secrets.namespace }} \
--set envName=dev \
--set rabbitmqVHost=tfrs-dev${{ inputs.suffix }}-vhost \
-n ${{ secrets.namespace }} -f ./values-dev-jan.yaml tfrs-scan-coordinator-dev${{ inputs.suffix }} .
fi
helm upgrade --install \
--set scanCoordinatorImageTagName=dev${{ inputs.suffix}} \
--set suffix=-dev${{ inputs.suffix }} \
--set namespace=${{ secrets.namespace }} \
--set envName=dev \
--set rabbitmqVHost=tfrs-dev${{ inputs.suffix }}-vhost \
-n ${{ secrets.namespace }} -f ./values-dev-jan.yaml tfrs-scan-coordinator-dev${{ inputs.suffix }} .
6 changes: 3 additions & 3 deletions .github/workflows/tfrs-release.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## For each release, the value of name, branches, RELEASE_NAME and PR_NUMBER need to be adjusted accordingly
## For each release, update lib/config.js: version and releaseBranch

name: TFRS release-2.14.0
name: TFRS release-2.15.0

on:
workflow_dispatch:
Expand All @@ -10,8 +10,8 @@ on:
env:
## The pull request number of the Tracking pull request to merge the release branch to main
## Also remember to update the version in .pipeline/lib/config.js
PR_NUMBER: 2737
RELEASE_NAME: release-2.14.0
PR_NUMBER: 2828
RELEASE_NAME: release-2.15.0

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
4 changes: 2 additions & 2 deletions .pipeline/lib/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
const options= require('@bcgov/pipeline-cli').Util.parseArguments()
const changeId = options.pr //aka pull-request
const version = '2.14.0'
const version = '2.15.0'
const name = 'tfrs'
const ocpName = 'apps.silver.devops'

Expand All @@ -13,7 +13,7 @@ options.git.repository='tfrs'
const phases = {
build: { namespace:'0ab226-tools' , name: `${name}`, phase: 'build' , changeId:changeId, suffix: `-build-${changeId}` ,
instance: `${name}-build-${changeId}` , version:`${version}-${changeId}`, tag:`build-${version}-${changeId}`,
releaseBranch: 'release-2.14.0'
releaseBranch: 'release-2.15.0'
},
dev: {namespace:'0ab226-dev' , name: `${name}`, phase: 'dev' , changeId:changeId, suffix: `-dev` ,
instance: `${name}-dev` , version:`${version}`, tag:`dev-${version}`, dbServiceName: 'tfrs-spilo',
Expand Down
2 changes: 1 addition & 1 deletion backend/api/services/ComplianceReportService.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def create_director_transactions(compliance_report, creating_user):
# Code 26C is used to identify credits that must be refunded to the supplier.
# This occurs when our debit position decreases and we have already spent credits.
# In such cases, any excess credits must be returned to the supplier.
if is_supplemental and Decimal(lines['26C']) > 0:
if is_supplemental and Decimal(lines.get('26C', 0)) > 0:
print("*** DIRECTOR 26C Increase to Credits ***")
required_credit_transaction = Decimal(lines['26C'])

Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tfrs",
"version": "2.14.0",
"version": "2.15.0",
"dependencies": {
"@babel/eslint-parser": "^7.19.1",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
Expand Down
8 changes: 7 additions & 1 deletion openshift-v4/templates/maintenance-page/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@ FROM artifacts.developer.gov.bc.ca/docker-remote/httpd:2.4.46
COPY ./httpd.conf /usr/local/apache2/conf/httpd.conf
COPY ./public-html/ /usr/local/apache2/htdocs/
RUN chgrp -R root /usr/local/apache2/logs \
&& chmod -R g+w /usr/local/apache2/logs
&& chmod -R g+w /usr/local/apache2/logs
RUN apt-get update && apt-get install -y curl
RUN which curl
RUN curl --insecure --silent -L -o /tmp/oc.tar https://downloads-openshift-console.apps.silver.devops.gov.bc.ca/arm64/linux/oc.tar
WORKDIR /tmp
RUN tar xvf oc.tar && \
cp oc /bin

0 comments on commit 620006b

Please sign in to comment.