Skip to content

Commit

Permalink
feat: add prototype app (#12)
Browse files Browse the repository at this point in the history
* chore: update .gitignore

* chore: add .gitattributes

* chore: add .editorconfig

* feat: add prototype codes application

* feat: replace sample frontend, backend, and tests with prototype
  • Loading branch information
MikeLyttle authored Nov 29, 2024
1 parent 4f63de5 commit bcb2ed9
Show file tree
Hide file tree
Showing 217 changed files with 63,794 additions and 34,037 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
charset = utf-8

[*.{yml,yaml}]
indent_size = 2
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto eol=lf
2 changes: 1 addition & 1 deletion .github/workflows/.deployer-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ on:
required: false
type: boolean
triggers:
description: Paths used to trigger a deployment; e.g. ('./backend/' './frontend/)
description: Paths used to trigger a deployment; e.g. ('./apps/' './charts/)
required: false
type: string

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/.deployer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ on:
required: false
type: string
triggers:
description: Paths used to trigger a deployment; e.g. ('./backend/' './frontend/)
description: Paths used to trigger a deployment; e.g. ('./apps/' './charts/)
required: false
type: string
db_user:
Expand Down
100 changes: 0 additions & 100 deletions .github/workflows/.tests.yml

This file was deleted.

91 changes: 0 additions & 91 deletions .github/workflows/analysis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ jobs:
oc delete route/${{ env.REPO }}-${{ env.DEST }} --ignore-not-found=true
oc create route edge ${{ env.REPO }}-${{ env.DEST }} \
--hostname=${{ env.REPO }}-${{ env.DEST }}.${{ env.DOMAIN }} \
--service=${{ env.REPO }}-${{ github.event.number || inputs.target }}-frontend
--service=${{ env.REPO }}-${{ github.event.number || inputs.target }}-backend
4 changes: 1 addition & 3 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ jobs:
# tag: ${{ needs.vars.outputs.pr }}
# params:
# --set backend.deploymentStrategy=RollingUpdate
# --set frontend.deploymentStrategy=RollingUpdate
# --set global.autoscaling=true
# --set frontend.pdb.enabled=true
# --set backend.pdb.enabled=true

# promote:
Expand All @@ -82,7 +80,7 @@ jobs:
# packages: write
# strategy:
# matrix:
# package: [migrations, backend, frontend]
# package: [migrations, backend]
# timeout-minutes: 1
# steps:
# - uses: shrink/actions-docker-registry-tag@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-close.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
oc_token: ${{ secrets.OC_TOKEN }}
with:
cleanup: helm
packages: backend frontend migrations
packages: backend migrations

cleanup_db: # TODO move it off to another action later.
name: Remove DB User from crunchy
Expand Down
26 changes: 12 additions & 14 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,24 @@ jobs:
builds:
name: Builds
runs-on: ubuntu-24.04
strategy:
matrix:
package: [backend, frontend, migrations]
timeout-minutes: 10
steps:
- uses: bcgov-nr/[email protected]
with:
keep_versions: 50
package: ${{ matrix.package }}
package: migrations
tag: ${{ github.event.number }}
tag_fallback: latest
triggers: ('${{ matrix.package }}/')
triggers: ('migrations/')
- uses: bcgov-nr/[email protected]
with:
keep_versions: 50
package: backend
build_context: apps
build_file: apps/Codes/Codes.Server/Dockerfile
tag: ${{ github.event.number }}
tag_fallback: latest
triggers: ('apps/')

# https://github.com/bcgov/quickstart-openshift-helpers
deploys:
Expand All @@ -35,18 +41,10 @@ jobs:
oc_namespace: ${{ secrets.OC_NAMESPACE }}
oc_token: ${{ secrets.OC_TOKEN }}
with:
triggers: ('backend/' 'frontend/' 'migrations/' 'charts/')
triggers: ('apps/' 'migrations/' 'charts/')
db_user: app-${{github.event.number}}
params: --set global.secrets.persist=false

# tests:
# name: Tests
# if: needs.deploys.outputs.triggered == 'true'
# needs: [deploys]
# uses: ./.github/workflows/.tests.yml
# with:
# target: ${{ github.event.number }}

results:
name: PR Results
needs: [builds, deploys]
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/pr-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ jobs:
uses: bcgov/quickstart-openshift-helpers/.github/workflows/[email protected]
with:
markdown_links: |
- [Frontend](https://${{ github.event.repository.name }}-${{ github.event.number }}-frontend.apps.silver.devops.gov.bc.ca)
- [Backend](https://${{ github.event.repository.name }}-${{ github.event.number }}-frontend.apps.silver.devops.gov.bc.ca/api)
- [Codes](https://${{ github.event.repository.name }}-${{ github.event.number }}-backend.apps.silver.devops.gov.bc.ca)
results:
name: Validate Results
Expand Down
11 changes: 1 addition & 10 deletions .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,4 @@ jobs:
# artifact_name: "zap_backend"
# cmd_options: "-a"
# issue_title: "ZAP: Backend"
# target: https://${{ env.PREFIX }}-frontend.${{ env.DOMAIN }}/api

# - name: ZAP Scan - Frontend
# uses: zaproxy/[email protected]
# with:
# allow_issue_writing: true
# artifact_name: "zap_frontend"
# cmd_options: "-a"
# issue_title: "ZAP: Frontend"
# target: https://${{ env.PREFIX }}-frontend.${{ env.DOMAIN }}
# target: https://${{ env.PREFIX }}-backend.${{ env.DOMAIN }}
Loading

0 comments on commit bcb2ed9

Please sign in to comment.