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

Document services CI/CD. #36

Merged
merged 3 commits into from
Aug 27, 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
30 changes: 30 additions & 0 deletions .github/workflows/doc-api-cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Doc API CD

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

jobs:
doc-api-cd:
uses: bcgov/bcregistry-sre/.github/workflows/backend-cd.yaml@main
with:
target: ${{ inputs.target }}
app_name: "doc-api"
working_directory: "./document-service/doc-api"
secrets:
WORKLOAD_IDENTIFY_POOLS_PROVIDER: ${{ secrets.WORKLOAD_IDENTIFY_POOLS_PROVIDER }}
GCP_SERVICE_ACCOUNT: ${{ secrets.GCP_SERVICE_ACCOUNT }}
20 changes: 20 additions & 0 deletions .github/workflows/doc-api-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Doc API CI

on:
pull_request:
paths:
- "document-service/doc-api/**"
workflow_dispatch:

defaults:
run:
shell: bash
working-directory: ./document-service/doc-api

jobs:
doc-api-ci:
uses: bcgov/bcregistry-sre/.github/workflows/backend-ci.yaml@main
with:
app_name: "doc-api"
working_directory: "./document-service/doc-api"
codecov_flag: "docapi"
30 changes: 30 additions & 0 deletions .github/workflows/documents-ui-cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Documents UI CD

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

jobs:
documents-ui-cd:
uses: bcgov/bcregistry-sre/.github/workflows/frontend-cd.yaml@main
with:
target: ${{ inputs.target }}
app_name: "documents-ui"
working_directory: "./document-service/documents-ui"
secrets:
WORKLOAD_IDENTIFY_POOLS_PROVIDER: ${{ secrets.WORKLOAD_IDENTIFY_POOLS_PROVIDER }}
GCP_SERVICE_ACCOUNT: ${{ secrets.GCP_SERVICE_ACCOUNT }}
20 changes: 20 additions & 0 deletions .github/workflows/documents-ui-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Documents UI CI

on:
pull_request:
paths:
- "document-service/documents-ui/**"
workflow_dispatch:

defaults:
run:
shell: bash
working-directory: ./document-service/documents-ui

jobs:
documents-ui-ci:
uses: bcgov/bcregistry-sre/.github/workflows/frontend-ci.yaml@main
with:
app_name: "documents-ui"
working_directory: "./document-service/documents-ui"
codecov_flag: "documentsui"
8 changes: 7 additions & 1 deletion codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ coverage:
- notifydelivery
- reportapi
- statusapi
- docapi
- documentsui

ui:
target: 80%
Expand Down Expand Up @@ -57,7 +59,11 @@ flags:
paths:
- status-api/src/status_api
carryforward: true
docapi:
paths:
- document-service/doc-api/src/doc_api
carryforward: true
documentsui:
paths:
- document-service/documents-ui/src
- document-service/documents-ui
carryforward: true
78 changes: 78 additions & 0 deletions document-service/doc-api/devops/gcp/clouddeploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: deploy.cloud.google.com/v1
kind: DeliveryPipeline
metadata:
name: doc-api-pipeline
description: Deployment pipeline
serialPipeline:
stages:
- targetId: c4hnrd-dev
profiles: [dev]
strategy:
standard:
verify: false
deployParameters:
- values:
deploy-env: "development"
deploy-project-id: "c4hnrd-dev"
service-name: "doc-api-dev"
container-name: "doc-api-dev"
cloudsql-instances: "c4hnrd-dev:northamerica-northeast1:common-db-dev"
service-account: "sa-api@c4hnrd-dev.iam.gserviceaccount.com"
- targetId: c4hnrd-test
profiles: [test]
strategy:
standard:
verify: false
deployParameters:
- values:
deploy-env: "test"
deploy-project-id: "c4hnrd-test"
service-name: "doc-api-test"
container-name: "doc-api-test"
app-env: "test"
cloudsql-instances: "c4hnrd-test:northamerica-northeast1:common-db-test"
service-account: "sa-api@c4hnrd-test.iam.gserviceaccount.com"
- targetId: c4hnrd-sandbox
profiles: [sandbox]
strategy:
standard:
verify: false
deployParameters:
- values:
deploy-env: "sandbox"
deploy-project-id: "c4hnrd-sandbox"
service-name: "doc-api-sandbox"
container-name: "doc-api-sandbox"
app-env: "sandbox"
cloudsql-instances: "c4hnrd-sandbox:northamerica-northeast1:common-db-sandbox"
service-account: "sa-api@c4hnrd-sandbox.iam.gserviceaccount.com"
- targetId: c4hnrd-prod
profiles: [prod]
strategy:
standard:
verify: false
deployParameters:
- values:
deploy-env: "production"
deploy-project-id: "c4hnrd-prod"
service-name: "doc-api-prod"
container-name: "doc-api-prod"
app-env: "production"
cloudsql-instances: "c4hnrd-prod:northamerica-northeast1:common-db-prod"
service-account: "sa-api@c4hnrd-prod.iam.gserviceaccount.com"
max-scale: "10"
container-concurrency: "20"
19 changes: 19 additions & 0 deletions document-service/doc-api/devops/vaults.gcp.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
JWT_OIDC_WELL_KNOWN_CONFIG="op://keycloak/$APP_ENV/jwt-base/JWT_OIDC_WELL_KNOWN_CONFIG"
JWT_OIDC_ISSUER="op://keycloak/$APP_ENV/jwt-base/JWT_OIDC_ISSUER"
JWT_OIDC_JWKS_CACHE_TIMEOUT="op://keycloak/$APP_ENV/jwt-base/JWT_OIDC_JWKS_CACHE_TIMEOUT"
JWT_OIDC_CACHING_ENABLED="op://keycloak/$APP_ENV/jwt-base/JWT_OIDC_CACHING_ENABLED"
JWT_OIDC_ALGORITHMS="op://keycloak/$APP_ENV/jwt-base/JWT_OIDC_ALGORITHMS"
ACCOUNT_SERVICES_SERVICE_ACCOUNT_CLIENT_ID="op://keycloak/$APP_ENV/account-services-account/ACCOUNT_SERVICES_SERVICE_ACCOUNT_CLIENT_ID"
DOC_DATABASE_USERNAME="op://database/$APP_ENV/common-db/DATABASE_USERNAME"
DOC_DATABASE_PASSWORD="op://database/$APP_ENV/common-db/DATABASE_PASSWORD"
DOC_DATABASE_PORT="op://database/$APP_ENV/common-db/DATABASE_PORT"
DOC_DATABASE_NAME="op://database/$APP_ENV/common-db/DATABASE_NAME"
DOC_DATABASE_UNIX_SOCKET="op://database/$APP_ENV/common-db/DATABASE_UNIX_SOCKET"
GCP_AUTH_KEY="op://buckets/$APP_ENV/doc-api/GCP_AUTH_KEY"
GCP_CS_SA_SCOPES="op://buckets/$APP_ENV/doc-api/GCP_CS_SA_SCOPES"
GCP_CS_BUCKET_ID_BUS="op://buckets/$APP_ENV/doc-api/GCP_CS_BUCKET_ID_BUS"
GCP_CS_BUCKET_ID_MHR="op://buckets/$APP_ENV/doc-api/GCP_CS_BUCKET_ID_MHR"
GCP_CS_BUCKET_ID_PPR="op://buckets/$APP_ENV/doc-api/GCP_CS_BUCKET_ID_PPR"
GCP_CS_BUCKET_ID_NR="op://buckets/$APP_ENV/doc-api/GCP_CS_BUCKET_ID_NR"
REPORT_SVC_URL="op://API/$APP_ENV/report-api-gotenberg/REPORT_API_GOTENBERG_URL"
REPORT_TEMPLATE_PATH="op://API/$APP_ENV/report-api-gotenberg/REPORT_TEMPLATE_PATH"
6 changes: 6 additions & 0 deletions document-service/documents-ui/.gcloudignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.firebase
.gcloudignore
.git
.gitignore
.output
/node_modules/
20 changes: 20 additions & 0 deletions document-service/documents-ui/devops/vaults.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
VUE_APP_PATH="/"
VUE_APP_REGISTRY_URL="op://web-url/$APP_ENV/registry/REGISTRY_URL"
VUE_APP_REGISTRY_HOME_URL="op://web-url/$APP_ENV/registry/REGISTRY_HOME_URL"
VUE_APP_AUTH_WEB_URL="op://web-url/$APP_ENV/auth-web/AUTH_WEB_URL"
VUE_APP_BCONLINE_URL="op://web-url/$APP_ENV/bconline/BCONLINE_URL"
VUE_APP_DOC_API_URL="op://API/$APP_ENV/doc-api/DOC_API_URL"
VUE_APP_DOC_API_VERSION="op://API/$APP_ENV/doc-api/DOC_API_VERSION"
VUE_APP_DOC_API_KEY=op://API/$APP_ENV/doc-api/DOC_API_KEY
VUE_APP_AUTH_API_URL="op://API/$APP_ENV/auth-api/AUTH_API_URL"
VUE_APP_AUTH_API_VERSION="op://API/$APP_ENV/auth-api/AUTH_API_VERSION"
VUE_APP_PAY_API_URL="op://API/$APP_ENV/pay-api/PAY_API_URL"
VUE_APP_PAY_API_VERSION="op://API/$APP_ENV/pay-api/PAY_API_VERSION"
VUE_APP_LEGAL_API_URL="op://API/$APP_ENV/legal-api/LEGAL_API_URL"
VUE_APP_LEGAL_API_VERSION_2="op://API/$APP_ENV/legal-api/LEGAL_API_VERSION_2"
VUE_APP_STATUS_API_URL="op://API/$APP_ENV/status-api/STATUS_API_URL"
VUE_APP_STATUS_API_VERSION="op://API/$APP_ENV/status-api/STATUS_API_VERSION"
VUE_APP_KEYCLOAK_AUTH_URL="op://keycloak/$APP_ENV/base/KEYCLOAK_AUTH_BASE_URL"
VUE_APP_KEYCLOAK_REALM="op://keycloak/$APP_ENV/base/KEYCLOAK_REALMNAME"
VUE_APP_KEYCLOAK_CLIENTID="op://keycloak/$APP_ENV/entity-web/UI_KEYCLOAK_RESOURCE_NAME"
VUE_APP_LD_CLIENT_ID="op://launchdarkly/$APP_ENV/business-filings/BUSINESS_FILING_LD_CLIENT_ID"
34 changes: 34 additions & 0 deletions document-service/documents-ui/firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"hosting":
{
"site": "documents-ui-dev",
"public": "dist",
"ignore": ["**/devops/**", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
],
"headers" : [
{
"source": "**",
"headers" : [
{ "key" : "Access-Control-Allow-Origin", "value" : "*" },
{ "key" : "X-Frame-Options", "value" : "DENY" },
{ "key" : "X-Content-Type-Options", "value" : "nosniff" },
{ "key" : "X-XSS-Protection", "value" : "1; mode=block" },
{
"key": "Content-Security-Policy",
"value": "default-src 'self'; frame-src 'self' *.gov.bc.ca *.hotjar.com *.googleapis.com https://*.nr-data.net https://*.newrelic.com https://*.cac1.pure.cloud; script-src 'self' 'unsafe-eval' 'unsafe-inline' *.gov.bc.ca *.hotjar.com *.googleapis.com https://*.nr-data.net https://*.newrelic.com https://*.cac1.pure.cloud; style-src 'self' 'unsafe-inline' *.cloudflare.com *.googleapis.com *.jsdelivr.net; font-src 'self' *.gov.bc.ca *.hotjar.com *.cloudflare.com *.googleapis.com *.gstatic.com *.jsdelivr.net; img-src 'self' data: *.hotjar.com https://*.cac1.pure.cloud; connect-src 'self' *.gov.bc.ca *.launchdarkly.com *.run.app *.hotjar.com *.postescanada-canadapost.ca *.sentry.io *.apigee.net wss://*.hotjar.com *.hotjar.io https://*.nr-data.net https://shyrka-prod-cac1.s3.ca-central-1.amazonaws.com https://*.newrelic.com https://*.cac1.pure.cloud wss://*.cac1.pure.cloud; manifest-src 'self'; media-src 'self' https://*.cac1.pure.cloud; object-src 'self' https://*.cac1.pure.cloud; child-src 'self' https://*.cac1.pure.cloud;"
},
{ "key": "Cache-Control", "value": "no-cache, no-store, must-revalidate"},
{ "key": "Pragma", "value": "no-cache"},
{ "key": "Referrer-Policy", "value": "no-referrer" },
{ "key": "Feature-Policy", "value": "microphone 'self'" },
{ "key": "Strict-Transport-Security", "value": "max-age=31536000;" }
]
}
]
}
}
5 changes: 3 additions & 2 deletions document-service/documents-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "bcros-documents-ui",
"version": "0.0.6",
"version": "0.0.7",
"private": true,
"type": "module",
"scripts": {
"build": "nuxt build",
"build-check": "nuxt build",
"build": "nuxt generate",
"dev": "nuxt dev",
"generate": "nuxt generate",
"lint": "eslint",
Expand Down
Loading