Skip to content

Commit

Permalink
Merge pull request #882 from bcgov/test-rook-MD-merge-dev-mar18
Browse files Browse the repository at this point in the history
Test-Rook - Merge dev branch into test-rook
  • Loading branch information
milosdes authored Mar 19, 2024
2 parents 12a3f7e + 2890da8 commit 3c35e7c
Show file tree
Hide file tree
Showing 205 changed files with 24,770 additions and 6,554 deletions.
106 changes: 106 additions & 0 deletions .github/workflows/documentservice-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Document Services CD


on:
push:
branches:
- dev
- main
- dev-marshal
- test-marshal
- dev-rook
- test-rook
paths:
- "computingservices/DocumentServices/**"
- ".github/workflows/documentservice-cd.yml"

defaults:
run:
shell: bash
working-directory: ./computingservices/DocumentServices

env:
APP_NAME: "reviewer-documentservice"
TOOLS_NAME: "${{secrets.OPENSHIFT4_REPOSITORY}}"

jobs:
documentServices-cd-by-push:
runs-on: ubuntu-20.04

if: github.event_name == 'push' && github.repository == 'bcgov/foi-docreviewer'
steps:
- uses: actions/checkout@v2
- name: Set ENV variables for dev branch
if: ${{ github.ref_name == 'dev' }}
shell: bash
run: |
echo "For ${{ github.ref_name }} branch"
echo "TAG_NAME=dev" >> $GITHUB_ENV
echo "BRANCH_NAME=dev" >> $GITHUB_ENV
echo "ENV_NAME=dev" >> $GITHUB_ENV
- name: Set ENV variables for main branch
if: ${{ github.ref_name == 'main' }}
shell: bash
run: |
echo "For ${{ github.ref_name }} branch"
echo "TAG_NAME=test" >> $GITHUB_ENV
echo "BRANCH_NAME=main" >> $GITHUB_ENV
echo "ENV_NAME=test" >> $GITHUB_ENV
- name: Set ENV variables for dev-marshal branch
if: ${{ github.ref_name == 'dev-marshal' }}
run: |
echo "For ${{ github.ref_name }} branch"
echo "TAG_NAME=dev-marshal" >> $GITHUB_ENV
echo "BRANCH_NAME=dev-marshal" >> $GITHUB_ENV
echo "ENV_NAME=dev" >> $GITHUB_ENV
- name: Set ENV variables for test-marshal branch
if: ${{ github.ref_name == 'test-marshal' }}
run: |
echo "For ${{ github.ref_name }} branch"
echo "TAG_NAME=test-marshal" >> $GITHUB_ENV
echo "BRANCH_NAME=test-marshal" >> $GITHUB_ENV
echo "ENV_NAME=test" >> $GITHUB_ENV
- name: Set ENV variables for dev-rook branch
if: ${{ github.ref_name == 'dev-rook' }}
run: |
echo "For ${{ github.ref_name }} branch"
echo "TAG_NAME=dev-rook" >> $GITHUB_ENV
echo "BRANCH_NAME=dev-rook" >> $GITHUB_ENV
echo "ENV_NAME=dev" >> $GITHUB_ENV
- name: Set ENV variables for test-rook branch
if: ${{ github.ref_name == 'test-rook' }}
run: |
echo "For ${{ github.ref_name }} branch"
echo "TAG_NAME=test-rook" >> $GITHUB_ENV
echo "BRANCH_NAME=test-rook" >> $GITHUB_ENV
echo "ENV_NAME=test" >> $GITHUB_ENV
- name: Login Openshift
shell: bash
run: |
oc login --server=${{secrets.OPENSHIFT4_LOGIN_REGISTRY}} --token=${{secrets.OPENSHIFT4_SA_TOKEN}}
- name: Tools project
shell: bash
run: |
oc project ${{ env.TOOLS_NAME }}-tools
- name: Build from ${{ env.BRANCH_NAME }} branch
shell: bash
run: |
oc patch bc/${{ env.APP_NAME }}-build -p '{"spec":{"source":{"contextDir":"/computingservices/DocumentServices","git":{"ref":"${{ env.BRANCH_NAME }}"}}}}'
- name: Start Build Openshift
shell: bash
run: |
oc start-build ${{ env.APP_NAME }}-build --wait
- name: Tag+Deploy for ${{ env.TAG_NAME }}
shell: bash
run: |
oc tag ${{ env.APP_NAME }}:latest ${{ env.APP_NAME }}:${{ env.TAG_NAME }}
54 changes: 54 additions & 0 deletions .github/workflows/documentservice-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Document Services CI


on:
pull_request:
branches:
- main
- dev
- dev-marshal
- test-marshal
- dev-rook
- test-rook
paths:
- "computingservices/DocumentServices/**"

defaults:
run:
shell: bash
working-directory: ./computingservices/DocumentServices

jobs:
docker-build-check:
runs-on: ubuntu-20.04
name: Build dockerfile to ensure it works

steps:
- uses: actions/checkout@v2
- name: docker build to check strictness
id: docker-build
run: |
docker build -f Dockerfile.local .
python-build-check:
runs-on: ubuntu-20.04
name: Build python to ensure it works

strategy:
matrix:
# python-version: [3.6, 3.7, 3.8, 3.9]
python-version: [3.9]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
13 changes: 7 additions & 6 deletions .github/workflows/zap-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
branches:
- dev
- dev-ac-1398
- dev-RQ-3026

workflow_dispatch:
inputs:
Expand All @@ -26,7 +27,7 @@ jobs:
name: Scan the frontend
steps:
- name: ZAP Scan
uses: zaproxy/action-full-scan@v0.4.0
uses: zaproxy/action-full-scan@v0.9.0
with:
allow_issue_writing: false
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -39,7 +40,7 @@ jobs:
name: Scan the forms frontend
steps:
- name: ZAP Scan
uses: zaproxy/action-full-scan@v0.4.0
uses: zaproxy/action-full-scan@v0.9.0
with:
allow_issue_writing: false
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -51,22 +52,22 @@ jobs:
name: Scan the reviewer frontend
steps:
- name: ZAP Scan
uses: zaproxy/action-full-scan@v0.4.0
uses: zaproxy/action-full-scan@v0.9.0
with:
allow_issue_writing: false
token: ${{ secrets.GITHUB_TOKEN }}
issue_title: 'ZAP Scan Report'
target: ${{ secrets.ZAP_SCAN_REVIEWER_URL }}
target: ${{ secrets.ZAP_SCAN_REVIEWER_URL_DEV }}


zap_scan_backend:
runs-on: ubuntu-latest
name: Scan the backend
steps:
- name: ZAP Scan
uses: zaproxy/action-api-scan@v0.2.0
uses: zaproxy/action-api-scan@v0.6.0
with:
allow_issue_writing: false
token: ${{ secrets.GITHUB_TOKEN }}
issue_title: 'ZAP Scan Report'
target: ${{ secrets.ZAP_SCAN_BACKEND_URL }}
target: ${{ secrets.ZAP_SCAN_BACKEND_URL_DEV }}
Loading

0 comments on commit 3c35e7c

Please sign in to comment.