Skip to content

Commit

Permalink
Init template, secrets and workflow changes (#583)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts authored Nov 6, 2022
1 parent 134e859 commit c496f92
Show file tree
Hide file tree
Showing 21 changed files with 309 additions and 44 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/merge-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,15 @@ jobs:
name: TEST Deployments
needs:
- codeql
uses: bcgov/nr-quickstart-helpers/.github/workflows/_deploy.yml@v0.0.2
uses: bcgov/nr-quickstart-helpers/.github/workflows/_deploy.yml@main
strategy:
matrix:
component: [backend, database, frontend]
component: [init, backend, database, frontend]
include:
- component: init
overwrite: false
template_file: common/openshift.init.yml
template_vars: -p ZONE=${{ github.event.number }}
- component: database
overwrite: false
template_file: database/openshift.deploy.yml
Expand Down Expand Up @@ -161,11 +165,15 @@ jobs:
name: PROD Deployments
needs:
- trivy-repo
uses: bcgov/nr-quickstart-helpers/.github/workflows/_deploy.yml@v0.0.2
uses: bcgov/nr-quickstart-helpers/.github/workflows/_deploy.yml@main
strategy:
matrix:
component: [backend, database, frontend]
component: [init, backend, database, frontend]
include:
- component: init
overwrite: false
template_file: common/openshift.init.yml
template_vars: -p ZONE=${{ github.event.number }}
- component: database
overwrite: false
template_file: database/openshift.deploy.yml
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,15 @@ jobs:
- builds
# # If any of the prerequs created a build, then deploy
# if: contains(needs.*.outputs.build, 'true')
uses: bcgov/nr-quickstart-helpers/.github/workflows/_deploy.yml@v0.0.2
uses: bcgov/nr-quickstart-helpers/.github/workflows/_deploy.yml@main
strategy:
matrix:
component: [backend, database, frontend]
component: [init, backend, database, frontend]
include:
- component: init
overwrite: false
template_file: common/openshift.init.yml
template_vars: -p ZONE=${{ github.event.number }}
- component: database
overwrite: false
template_file: database/openshift.deploy.yml
Expand Down
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ This project is in active development. Please visit our [issues](https://github

### Workflow 1 of 3: PR Open

![1/3: PR Open](.github/graphics/pipeline1of3.png)
![1/3: PR Open](common/graphics/pipeline1of3.png)

### Workflow 2 of 3: PR Close

![2/3: PR Close](.github/graphics/pipeline2of3.png)
![2/3: PR Close](common/graphics/pipeline2of3.png)

### Workflow 3 of 3: Main Merge

![3/3: Main Merge](.github/graphics/pipeline3of3.png)
![3/3: Main Merge](common/graphics/pipeline3of3.png)

### Deployments

Expand All @@ -62,13 +62,13 @@ Deployment to test, staging or pre-prod (pick a name!) is currently planned to b

Successful deployments are linked in Pull Request comments.

![Deployment Update](.github/graphics/deploymentUpdate.png)
![Deployment Update](common/graphics/deploymentUpdate.png)

### Builds

Builds are handled by Docker Actions and published to the GitHub Container Registry (ghcr.io). This allows for publicly accessible builds that can be consumed by OpenShift, Amazon Web Services or any other container service.

![Packages](.github/graphics/packages.png)
![Packages](common/graphics/packages.png)

### Testing

Expand All @@ -83,7 +83,7 @@ Code quality is reporting are performed by:

Sonar reports are provided as Pull Request comments.

![Sonar Cloud Update](.github/graphics/sonarUpdate.png)
![Sonar Cloud Update](common/graphics/sonarUpdate.png)

### Security Scanning

Expand Down Expand Up @@ -111,9 +111,9 @@ Higher-level environments come after DEV deployments and are usually called any

Optionally, higher-level deployments can be prevented until manually approved.

![Prod Request](.github/graphics/prodRequest.png)
![Prod Request](common/graphics/prodRequest.png)

![Prod Accept](.github/graphics/prodAccept.png)
![Prod Accept](common/graphics/prodAccept.png)

## Workflows

Expand All @@ -131,17 +131,17 @@ The workflow, located [here](https://github.com/bcgov/nr-quickstart-typescript/b
* [Jest](https://jestjs.io/) JavaScript testing enforced in-pipeline
* [SonarCloud](https://sonarcloud.io/) static analysis test coverage reporting

![Pull Request Open](.github/graphics/pr-open.png)
![Pull Request Open](common/graphics/pr-open.png)

Triggers are used to determine whether images need to be built or previous ones consumed. Partial or full skips, like when limited to documentation, are shown below.

![Pull Request Partially Skipped](.github/graphics/skipPartial.png)
![Pull Request Partially Skipped](common/graphics/skipPartial.png)

![Pull Request Fully Skipped](.github/graphics/skipFull.png)
![Pull Request Fully Skipped](common/graphics/skipFull.png)

When a PR is merged, the message comment below is added. Despite showing on this pull request it is actually handled by the next pipeline.

![Merge Notification](.github/graphics/mergeNotification.png)
![Merge Notification](common/graphics/mergeNotification.png)

### 2: Pull Request Close Pipeline

Expand All @@ -154,7 +154,7 @@ When a pull request is merged to main, one additional job is run. This promotes

* Image promotion to higher-level environments

![Pull Request Close/Merge](.github/graphics/pr-cleanup.png)
![Pull Request Close/Merge](common/graphics/pr-cleanup.png)

If this closure was triggered by a merge to the main branch it will trigger the following workflow.

Expand All @@ -169,7 +169,7 @@ The workflow, located [here](https://github.com/bcgov/nr-quickstart-typescript/b
* Higher-level deployments (e.g. TEST, STAGING, PRE-PROD, PROD)
* Publishing of production images to the GitHub Container Registry (ghcr.io)

![Main Merge](.github/graphics/main-merge.png)
![Main Merge](common/graphics/main-merge.png)

## Starter Application

Expand Down Expand Up @@ -234,7 +234,7 @@ The following are required:

### Consuming This Template

![image](./.github/graphics/newRepo.png)
![image](./common/graphics/newRepo.png)

Create a new repository using this repository as a template.
* Select bcgov/nr-quickstart-typescript under Repository template
Expand Down
Loading

0 comments on commit c496f92

Please sign in to comment.