Skip to content

Commit

Permalink
feat(ci): zap (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts committed Jan 31, 2024
1 parent 4c8032a commit dc80ef5
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 24 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/merge-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,14 @@ jobs:
oc_token: ${{ secrets.OC_TOKEN }}
overwrite: true
verification_path: /health
penetration_test: false
parameters:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
-p PROMOTE=${{ github.repository }}/api:${{ env.ZONE }}
-p ORACLEDB_USER=${{ secrets.ORACLEDB_USERNAME }}
-p ORACLEDB_PASSWORD=${{ secrets.ORACLEDB_PASSWORD }}
-p ORACLEDB_DATABASE=${{ secrets.ORACLEDB_DATABASE }}
-p ORACLEDB_HOST=${{ secrets.ORACLEDB_HOST }}
-p ORACLEDB_SERVICENAME=${{ secrets.ORACLEDB_SERVICENAME }}
-p ORACLEDB_SECRET=${{ secrets.ORACLEDB_SECRET }}
-p ZONE=${{ env.ZONE }}

- name: Publish API
uses: bcgov-nr/action-gwa-publish@v0.1.0
Expand Down Expand Up @@ -225,17 +223,15 @@ jobs:
oc_server: ${{ secrets.OC_SERVER }}
oc_token: ${{ secrets.OC_TOKEN }}
overwrite: true
penetration_test: false
verification_path: /health
parameters:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
-p PROMOTE=${{ github.repository }}/api:${{ env.ZONE }}
-p ORACLEDB_USER=${{ secrets.ORACLEDB_USERNAME }}
-p ORACLEDB_PASSWORD=${{ secrets.ORACLEDB_PASSWORD }}
-p ORACLEDB_DATABASE=${{ secrets.ORACLEDB_DATABASE }}
-p ORACLEDB_HOST=${{ secrets.ORACLEDB_HOST }}
-p ORACLEDB_SERVICENAME=${{ secrets.ORACLEDB_SERVICENAME }}
-p ORACLEDB_SECRET=${{ secrets.ORACLEDB_SECRET }}
-p ZONE=${{ env.ZONE }}
- name: Publish API
uses: bcgov-nr/action-gwa-publish@v0.1.0
with:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,13 @@ jobs:
overwrite: true
verification_path: /health
parameters:
-p ZONE=${{ github.event.number }} -p NAME=${{ github.event.repository.name }}
-p PROMOTE=${{ github.repository }}/api:${{ github.event.number }}
-p ORACLEDB_USER=${{ secrets.ORACLEDB_USERNAME }}
-p ORACLEDB_PASSWORD=${{ secrets.ORACLEDB_PASSWORD }}
-p ORACLEDB_DATABASE=${{ secrets.ORACLEDB_DATABASE }}
-p ORACLEDB_HOST=${{ secrets.ORACLEDB_HOST }}
-p ORACLEDB_SERVICENAME=${{ secrets.ORACLEDB_SERVICENAME }}
-p ORACLEDB_SECRET=${{ secrets.ORACLEDB_SECRET }}
-p ZONE=${{ github.event.number }}

postman:
name: Smoke Test
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Scheduled

on:
schedule: [cron: "0 11 * * 6"] # 3 AM PST = 12 PM UDT, Saturdays
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
zap_scan:
runs-on: ubuntu-latest
name: Penetration Tests
steps:
- name: ZAP Scan
uses: zaproxy/action-full-scan@v0.9.0
with:
allow_issue_writing: true
artifact_name: "zap_api"
cmd_options: "-a"
issue_title: "ZAP: API"
target: https://nr-forest-client-api-test-backend.apps.silver.devops.gov.bc.ca
11 changes: 2 additions & 9 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,9 @@ name: Unit Tests and Analysis

on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
types: [opened, reopened, synchronize, ready_for_review, converted_to_draft]
push:
branches:
- main
paths-ignore:
- "**.md"
branches: [main]
workflow_dispatch:

concurrency:
Expand Down
8 changes: 1 addition & 7 deletions openshift.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ parameters:
value: 75Mi
- name: MEMORY_LIMIT
value: 75Mi
- name: REGISTRY
description: Container registry to import from (internal is image-registry.openshift-image-registry.svc:5000)
value: ghcr.io
- name: PROMOTE
description: Image (namespace/name:tag) to promote/import
value: bcgov/nr-old-growth:prod-backend
- name: ORACLEDB_USER
description: Oracle database user name
required: true
Expand Down Expand Up @@ -88,7 +82,7 @@ objects:
- name: ${IMAGE_TAG}
from:
kind: DockerImage
name: ${REGISTRY}/${PROMOTE}
name: ghcr.io/bcgov/${NAME}/api:${ZONE}
referencePolicy:
type: Local
- apiVersion: v1
Expand Down

0 comments on commit dc80ef5

Please sign in to comment.