Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): zap #204

Merged
merged 6 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading