Skip to content

Commit

Permalink
Tracking pull request to merge release-2.8.0 to master (#2384)
Browse files Browse the repository at this point in the history
* initial update for 2.8.0

* update pr number in pipeline

* split dev release out from pipeline

* rename dev release name

* remove workflow runs

* add cron job to remove workflow runs

* chore: tfrs-2386 - delete old migrations

* update cleanup run cron

* update cleanup parameters

* sort issue fix for compliance reports

* fix for director not able to accept report

* add backup cron

---------

Co-authored-by: tim738745 <[email protected]>
Co-authored-by: Prashanth Venkateshappa <[email protected]>
Co-authored-by: Alex Zorkin <[email protected]>
Co-authored-by: jig-patel <[email protected]>
  • Loading branch information
5 people committed Jun 23, 2023
1 parent e5b863e commit 80ae1ef
Show file tree
Hide file tree
Showing 223 changed files with 610 additions and 11,441 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/cleanup-cron-workflow-runs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Scheduled cleanup old workflow runs
on:
schedule:
- cron: '0 0 * * 0'
# At 00:00 on Sunday.

jobs:
del_runs:
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Delete workflow runs
uses: Mattraks/[email protected]
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 15
keep_minimum_runs: 10
25 changes: 25 additions & 0 deletions .github/workflows/cleanup-workflow-runs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Cleanup old workflow runs
on:
workflow_dispatch:
inputs:
days:
description: 'Number of days.'
required: true
default: 15
minimum_runs:
description: 'The minimum runs to keep for each workflow.'
required: true
default: 10
jobs:
del_runs:
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Delete workflow runs
uses: Mattraks/[email protected]
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: ${{ github.event.inputs.days }}
keep_minimum_runs: ${{ github.event.inputs.minimum_runs }}
129 changes: 129 additions & 0 deletions .github/workflows/dev-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
## 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.8.0

on:
push:
branches: [ release-2.8.0 ]
paths:
- frontend/**
- backend/**
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: 2384
RELEASE_NAME: release-2.8.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-dev:

name: Deploy TFRS on Dev
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: Run deploy
run: |
cd .pipeline
npm install
npm run deploy -- --pr=${{ env.PR_NUMBER }} --env=dev
41 changes: 4 additions & 37 deletions .github/workflows/tfrs-release.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
## 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.7.0
name: TFRS release-2.8.0

on:
push:
branches: [ release-2.7.0 ]
paths:
- frontend/**
- backend/**
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: 2320
RELEASE_NAME: release-2.7.0
PR_NUMBER: 2384
RELEASE_NAME: release-2.8.0

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -99,40 +94,12 @@ jobs:
npm install
npm run build -- --pr=${{ env.PR_NUMBER }} --env=build
deploy-on-dev:

name: Deploy TFRS on Dev
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: Run deploy
run: |
cd .pipeline
npm install
npm run deploy -- --pr=${{ env.PR_NUMBER }} --env=dev
deploy-on-test:

name: Deploy TFRS on Test
runs-on: ubuntu-latest
timeout-minutes: 240
needs: deploy-on-dev
needs: build

steps:

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.7.0'
const version = '2.8.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.7.0'
releaseBranch: 'release-2.8.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
Loading

0 comments on commit 80ae1ef

Please sign in to comment.