Skip to content

TFRS release-2.22.0 #125

TFRS release-2.22.0

TFRS release-2.22.0 #125

Workflow file for this run

## 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.20.0
on:
workflow_dispatch:
workflow_call:
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: 2894
RELEASE_NAME: release-2.20.0
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
unit-test:
name: Run Backend Unit Tests
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Run coverage report for django tests
uses: kuanfandevops/django-test-action@itvr-django-test
continue-on-error: true
with:
settings-dir-path: "backend/api"
requirements-file: "backend/requirements.txt"
managepy-dir: backend
lint:
name: Linting
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Frontend Linting
continue-on-error: true
run: |
cd frontend
pwd
npm install
npm run lint
- name: Backend linting
uses: github/super-linter/slim@v4
continue-on-error: true
env:
DEFAULT_BRANCH: ${{ env.RELEASE_NAME }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FILTER_REGEX_INCLUDE: .*backend/.*.py
VALIDATE_PYTHON_PYLINT: true
LOG_LEVEL: WARN
build:
name: Build TFRS on Openshift
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
## it will checkout to /home/runner/work/itvr/itvr
- name: Check out repository
uses: actions/checkout@v3
## Log in to Openshift with a token of service account
- name: Log in to Openshift
##uses: redhat-actions/oc-login@v1
uses: smlgbl/oc-login@main
with:
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }}
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
insecure_skip_tls_verify: true
namespace: ${{ secrets.OPENSHIFT_NAMESPACE_PLATE }}-tools
## Run build on Openshift
- name: Run build
run: |
cd .pipeline
npm install
npm run build -- --pr=${{ env.PR_NUMBER }} --env=build
deploy-on-test:
name: Deploy TFRS on Test
runs-on: ubuntu-latest
timeout-minutes: 240
needs: build
steps:
## it will checkout to /home/runner/work/itvr/itvr
- name: Check out repository
uses: actions/checkout@v3
- name: Log in to Openshift
##uses: redhat-actions/oc-login@v1
uses: smlgbl/oc-login@main
with:
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }}
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
insecure_skip_tls_verify: true
namespace: ${{ secrets.OPENSHIFT_NAMESPACE_PLATE }}-tools
- name: Ask for approval for TFRS Test deployment
uses: trstringer/[email protected]
with:
secret: ${{ github.TOKEN }}
approvers: AlexZorkin,emi-hi,tim738745,kuanfandevops,jig-patel,prv-proton,JulianForeman
minimum-approvals: 1
issue-title: "TFRS ${{ env.RELEASE_NAME }} Test Deployment"
- name: Run deploy
run: |
cd .pipeline
npm install
npm run deploy -- --pr=${{ env.PR_NUMBER }} --env=test
deploy-on-prod:
name: Deploy TFRS on Prod
runs-on: ubuntu-latest
timeout-minutes: 2880
needs: deploy-on-test
steps:
## it will checkout to /home/runner/work/itvr/itvr
- name: Check out repository
uses: actions/checkout@v3
- name: Log in to Openshift
##uses: redhat-actions/oc-login@v1
uses: smlgbl/oc-login@main
with:
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }}
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
insecure_skip_tls_verify: true
namespace: ${{ secrets.OPENSHIFT_NAMESPACE_PLATE }}-tools
- name: Ask for approval for TFRS Prod deployment
uses: trstringer/[email protected]
with:
secret: ${{ github.TOKEN }}
approvers: AlexZorkin,kuanfandevops,tim738745,jig-patel,prv-proton,JulianForeman
minimum-approvals: 2
issue-title: "TFRS ${{ env.RELEASE_NAME }} Prod Deployment"
- name: Run deploy
run: |
cd .pipeline
npm install
npm run deploy -- --pr=${{ env.PR_NUMBER }} --env=prod