Skip to content

Commit

Permalink
Merge pull request #2296 from pwei1018/feature-legal-name
Browse files Browse the repository at this point in the history
Update CD flow for GCP migration.
  • Loading branch information
pwei1018 authored Nov 8, 2023
2 parents 276dd22 + 290525b commit d9669d0
Show file tree
Hide file tree
Showing 99 changed files with 2,113 additions and 2,209 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/business-api-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Business API CD

on:
push:
branches:
- main
paths:
- "legal-api/**"
workflow_dispatch:
inputs:
target:
description: "Deploy To"
required: true
type: choice
options:
- dev
- test
- sandbox
- prod

jobs:
business-api-cd:
uses: pwei1018/bcregistry-sre/.github/workflows/cloud-run-service-cd.yaml@main
with:
target: ${{ inputs.target }}
app_name: "business-api"
working_directory: "./legal-api"
secrets:
WORKLOAD_IDENTIFY_POOLS_PROVIDER: ${{ secrets.WORKLOAD_IDENTIFY_POOLS_PROVIDER }}
GCP_SERVICE_ACCOUNT: ${{ secrets.GCP_SERVICE_ACCOUNT }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Legal API CI
name: Business API CI

on:
pull_request:
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
DATABASE_HOST: localhost
DATABASE_PASSWORD: postgres
NATS_SERVERS: "nats://nats:4222"
NATS_CLIENT_NAME: entity.legal_api
NATS_CLIENT_NAME: entity.business_api
NATS_CLUSTER_ID: test-cluster
NATS_FILER_SUBJECT: entity.filing.filer
NATS_QUEUE: entity-filer-worker
Expand Down Expand Up @@ -95,9 +95,9 @@ jobs:
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./legal-api/coverage.xml
file: ./business-api/coverage.xml
flags: legalapi
name: codecov-legal-api
name: codecov-business-api
fail_ci_if_error: true

build-check:
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/business-auth-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Business Auth CD

on:
push:
branches:
- main
paths:
- "queue_services/entity-auth/**"
- "queue_services/common/**"
workflow_dispatch:
inputs:
target:
description: "Deploy To"
required: true
type: choice
options:
- dev
- test
- sandbox
- prod

jobs:
business-auth-cd:
uses: pwei1018/bcregistry-sre/.github/workflows/cloud-run-service-cd.yaml@main
with:
target: ${{ inputs.target }}
app_name: "business-auth"
working_directory: "./queue_services/entity-auth"
secrets:
WORKLOAD_IDENTIFY_POOLS_PROVIDER: ${{ secrets.WORKLOAD_IDENTIFY_POOLS_PROVIDER }}
GCP_SERVICE_ACCOUNT: ${{ secrets.GCP_SERVICE_ACCOUNT }}
121 changes: 121 additions & 0 deletions .github/workflows/business-auth-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: Business Auth CI

on:
pull_request:
types: [assigned, synchronize]
paths:
- "queue_services/entity-auth/**"
- "queue_services/common/**"

defaults:
run:
shell: bash
working-directory: ./queue_services/entity-auth

jobs:
setup-job:
runs-on: ubuntu-20.04

if: github.repository == 'bcgov/lear'

steps:
- uses: actions/checkout@v3
- run: "true"

linting:
needs: setup-job
runs-on: ubuntu-20.04

strategy:
matrix:
python-version: [3.8]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
make setup
- name: Lint with pylint
id: pylint
run: |
make pylint
- name: Lint with flake8
id: flake8
run: |
make flake8
testing:
needs: setup-job
env:
DATABASE_TEST_USERNAME: postgres
DATABASE_TEST_PASSWORD: postgres
DATABASE_TEST_NAME: postgres
DATABASE_TEST_HOST: localhost
DATABASE_HOST: localhost
DATABASE_PASSWORD: postgres
NATS_SERVERS: "nats://nats:4222"
NATS_CLIENT_NAME: entity.legal_api
NATS_CLUSTER_ID: test-cluster
NATS_FILER_SUBJECT: entity.filing.filer
NATS_QUEUE: entity-auth-worker
TEST_NATS_DOCKER: True
STAN_CLUSTER_NAME: test-cluster
JWT_OIDC_JWKS_CACHE_TIMEOUT: 300
GO_LIVE_DATE: 2019-08-12
LEGAL_API_URL: https://mock_legal_api_url
ACCOUNT_SVC_ENTITY_URL: https://mock_account_svc_entity_url
COLIN_API: https://mock_colin_api_url
ACCOUNT_SVC_AUTH_URL: https://mock_account_svc_auth_url
ACCOUNT_SVC_CLIENT_ID: account_svc_client_id
ACCOUNT_SVC_CLIENT_SECRET: account_svc_client_secret


runs-on: ubuntu-20.04

services:
postgres:
image: postgres:12
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
make setup
- name: Test with pytest
id: test
run: |
make test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./queue_services/entity-auth/coverage.xml
flags: entityfiler
name: codecov-entity-auth
fail_ci_if_error: true

build-check:
needs: setup-job
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
- name: build to check strictness
id: build
run: |
make build-nc
31 changes: 31 additions & 0 deletions .github/workflows/business-bn-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Business BN CD

on:
push:
branches:
- main
paths:
- "queue_services/entity-bn/**"
- "queue_services/common/**"
workflow_dispatch:
inputs:
target:
description: "Deploy To"
required: true
type: choice
options:
- dev
- test
- sandbox
- prod

jobs:
business-bn-cd:
uses: pwei1018/bcregistry-sre/.github/workflows/cloud-run-service-cd.yaml@main
with:
target: ${{ inputs.target }}
app_name: "business-bn"
working_directory: "./queue_services/entity-bn"
secrets:
WORKLOAD_IDENTIFY_POOLS_PROVIDER: ${{ secrets.WORKLOAD_IDENTIFY_POOLS_PROVIDER }}
GCP_SERVICE_ACCOUNT: ${{ secrets.GCP_SERVICE_ACCOUNT }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Entity BN CI
name: Business BN CI

on:
pull_request:
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/business-email-reminder-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Business Email Reminder Job CD

on:
push:
branches:
- main
paths:
- "./jobs/email-reminder/**"
workflow_dispatch:
inputs:
target:
description: "Deploy To"
required: true
type: choice
options:
- dev
- test
- sandbox
- prod

jobs:
business-email-reminder-cd:
uses: pwei1018/bcregistry-sre/.github/workflows/cloud-run-job-cd.yaml@main
with:
target: ${{ inputs.target }}
app_name: "business-email-reminder"
working_directory: "./jobs/email-reminder"
secrets:
WORKLOAD_IDENTIFY_POOLS_PROVIDER: ${{ secrets.WORKLOAD_IDENTIFY_POOLS_PROVIDER }}
GCP_SERVICE_ACCOUNT: ${{ secrets.GCP_SERVICE_ACCOUNT }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Email Reminder Job CI
name: Business Email Reminder Job CI

on:
pull_request:
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/business-emailer-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Business Emailer CD

on:
push:
branches:
- main
paths:
- "queue_services/entity-emailer/**"
- "queue_services/common/**"
workflow_dispatch:
inputs:
target:
description: "Deploy To"
required: true
type: choice
options:
- dev
- test
- sandbox
- prod

jobs:
business-emailer-cd:
uses: pwei1018/bcregistry-sre/.github/workflows/cloud-run-service-cd.yaml@main
with:
target: ${{ inputs.target }}
app_name: "business-emailer"
working_directory: "./queue_services/entity-emailer"
secrets:
WORKLOAD_IDENTIFY_POOLS_PROVIDER: ${{ secrets.WORKLOAD_IDENTIFY_POOLS_PROVIDER }}
GCP_SERVICE_ACCOUNT: ${{ secrets.GCP_SERVICE_ACCOUNT }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Entity Emailer CI
name: Business Emailer CI

on:
pull_request:
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/business-filer-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Business Filer CD

on:
push:
branches:
- main
paths:
- "queue_services/entity-filer/**"
- "queue_services/common/**"
workflow_dispatch:
inputs:
target:
description: "Deploy To"
required: true
type: choice
options:
- dev
- test
- sandbox
- prod

jobs:
business-filer-cd:
uses: pwei1018/bcregistry-sre/.github/workflows/cloud-run-service-cd.yaml@main
with:
target: ${{ inputs.target }}
app_name: "business-filer"
working_directory: "./queue_services/entity-filer"
secrets:
WORKLOAD_IDENTIFY_POOLS_PROVIDER: ${{ secrets.WORKLOAD_IDENTIFY_POOLS_PROVIDER }}
GCP_SERVICE_ACCOUNT: ${{ secrets.GCP_SERVICE_ACCOUNT }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Entity Filer CI
name: Business Filer CI

on:
pull_request:
Expand All @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-20.04

if: github.repository == 'bcgov/lear'

steps:
- uses: actions/checkout@v3
- run: "true"
Expand Down
Loading

0 comments on commit d9669d0

Please sign in to comment.