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: health check cron check #147

Merged
merged 11 commits into from
Apr 25, 2023
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
31 changes: 31 additions & 0 deletions .github/workflows/api-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: API Validation Check

on:
schedule:
- cron: '0 6 * * *'
workflow_dispatch:

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

jobs:
verify-api:
name: Verify API Health
runs-on: ubuntu-22.04
strategy:
matrix:
package: [ test, prod ]
env:
OS_DOMAIN: apps.silver.devops.gov.bc.ca
steps:
- uses: actions/checkout@v3

- name: Check Health on ${{ matrix.package }} environment
uses: matt-ball/newman-action@master
with:
collection: postman/OG.postman_collection.json
envVar: '[{"key":"URL_OG","value":"https://${{ github.event.repository.name }}-${{ matrix.package }}-backend.${{ env.OS_DOMAIN }}"}]'
reporters: '["cli"]'
folder: '["general"]'

18 changes: 8 additions & 10 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ jobs:

builds:
name: Image Build
runs-on: ubuntu-22.04
permissions:
packages: write
runs-on: ubuntu-22.04
permissions:
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -111,7 +111,7 @@ jobs:

deploy-database:
name: Deploy Database
needs:
needs:
- builds
environment: dev
runs-on: ubuntu-22.04
Expand All @@ -127,24 +127,24 @@ jobs:
overwrite: false
parameters:
-p ZONE=${{ github.event.number }} -p NAME=${{ github.event.repository.name }}

deploy-backend:
name: Deploy Backend
needs:
needs:
- deploy-database
environment: dev
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: Deploys
uses: bcgov-nr/[email protected]
with:
file: .github/openshift/deploy.backend.yml
oc_namespace: ${{ secrets.OC_NAMESPACE }}
oc_server: ${{ secrets.OC_SERVER }}
oc_token: ${{ secrets.OC_TOKEN }}
overwrite: true
overwrite: true
parameters:
-p ZONE=${{ github.event.number }} -p NAME=${{ github.event.repository.name }}
-p PROMOTE=${{ github.repository }}/backend:${{ github.event.number }}
Expand All @@ -155,5 +155,3 @@ jobs:
-p NODE_ENV='development'
-p BCEID_FORM_PASSWORD=${{ secrets.CHEFS_BCEID_FORM_PASSWORD}}
-p IDIR_FORM_PASSWORD=${{ secrets.CHEFS_IDIR_FORM_PASSWORD}}


2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
delete-old-comments: true
github-token: ${{ secrets.GHCR_TOKEN }}
lcov-file: ./backend/coverage/lcov.info

trivy:
name: Repository Report
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
Expand Down
44 changes: 44 additions & 0 deletions postman/OG.postman_collection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"info": {
"_postman_id": "8a93e7e0-b8e2-4eaf-a5e0-d41bf1b1aa6e",
"name": "nr-old-growth",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "17369587"
},
"item": [
{
"name": "Health",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"pm.test(\"Body matches OK\", function () {\r",
" pm.expect(pm.response.text()).to.include(\"Ok\");\r",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{URL_OG}}/check",
"host": [
"{{URL_OG}}"
],
"path": [
"check"
]
}
},
"response": []
}
]
}