Skip to content

Commit 693bca9

Browse files
authored
Chore: [AEA-0000] - add script to run all releases (#23)
## Summary - Routine Change ### Details - add script to run and approve all release up to and including int environment
1 parent 67fef01 commit 693bca9

File tree

7 files changed

+851
-58
lines changed

7 files changed

+851
-58
lines changed

.devcontainer/devcontainer.json

Lines changed: 47 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,53 @@
11
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
22
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
33
{
4-
"name": "Ubuntu",
5-
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"build": {
7-
"dockerfile": "Dockerfile",
8-
"context": "..",
9-
"args": {
10-
"DOCKER_GID": "${env:DOCKER_GID:}"
11-
}
12-
},
13-
"mounts": [
14-
"source=${env:HOME}${env:USERPROFILE}/.aws,target=/home/vscode/.aws,type=bind",
15-
"source=${env:HOME}${env:USERPROFILE}/.ssh,target=/home/vscode/.ssh,type=bind",
16-
"source=${env:HOME}${env:USERPROFILE}/.gnupg,target=/home/vscode/.gnupg,type=bind",
17-
"source=${env:HOME}${env:USERPROFILE}/.npmrc,target=/home/vscode/.npmrc,type=bind"
18-
],
19-
"containerUser": "vscode",
20-
"remoteEnv": { "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}" },
21-
"postAttachCommand": "docker build -f /workspaces/eps-common-workflows/dockerfiles/nhsd-git-secrets.dockerfile -t git-secrets . && pre-commit install --install-hooks -f",
22-
"features": {
23-
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
24-
"version": "latest",
25-
"moby": "true",
26-
"installDockerBuildx": "true"
27-
}
28-
},
29-
"customizations": {
30-
"vscode": {
31-
"extensions": [
32-
"AmazonWebServices.aws-toolkit-vscode",
33-
"redhat.vscode-yaml",
34-
"eamodio.gitlens",
35-
"github.vscode-pull-request-github",
36-
"streetsidesoftware.code-spell-checker",
37-
"timonwong.shellcheck",
38-
"github.vscode-github-actions"
39-
],
40-
"settings": {
41-
"cSpell.words": ["fhir", "Formik", "pino", "serialisation"]
42-
}
4+
"name": "Ubuntu",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"build": {
7+
"dockerfile": "Dockerfile",
8+
"context": "..",
9+
"args": {
10+
"DOCKER_GID": "${env:DOCKER_GID:}"
11+
}
12+
},
13+
"mounts": [
14+
"source=${env:HOME}${env:USERPROFILE}/.aws,target=/home/vscode/.aws,type=bind",
15+
"source=${env:HOME}${env:USERPROFILE}/.ssh,target=/home/vscode/.ssh,type=bind",
16+
"source=${env:HOME}${env:USERPROFILE}/.gnupg,target=/home/vscode/.gnupg,type=bind",
17+
"source=${env:HOME}${env:USERPROFILE}/.npmrc,target=/home/vscode/.npmrc,type=bind"
18+
],
19+
"containerUser": "vscode",
20+
"remoteEnv": {
21+
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
22+
},
23+
"postAttachCommand": "docker build -f /workspaces/eps-common-workflows/dockerfiles/nhsd-git-secrets.dockerfile -t git-secrets . && pre-commit install --install-hooks -f",
24+
"features": {
25+
"ghcr.io/devcontainers/features/github-cli:1": {},
26+
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
27+
"version": "latest",
28+
"moby": "true",
29+
"installDockerBuildx": "true"
30+
}
31+
},
32+
"customizations": {
33+
"vscode": {
34+
"extensions": [
35+
"AmazonWebServices.aws-toolkit-vscode",
36+
"redhat.vscode-yaml",
37+
"eamodio.gitlens",
38+
"github.vscode-pull-request-github",
39+
"streetsidesoftware.code-spell-checker",
40+
"timonwong.shellcheck",
41+
"github.vscode-github-actions"
42+
],
43+
"settings": {
44+
"cSpell.words": [
45+
"fhir",
46+
"Formik",
47+
"pino",
48+
"serialisation"
49+
]
4350
}
4451
}
4552
}
53+
}

.gitallowed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ password: \${{ secrets\.GITHUB_TOKEN }}
55
def __init__\(self, token: str, owner: str, repo: str.*
66
self\.token = token
77
token = os\.environ\.get\(\"GH_TOKEN\"\)
8+
poetry\.lock
89
\-Dsonar\.token=\"\$SONAR_TOKEN\"

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,3 +236,29 @@ repos:
236236
- 'docker run -v "$LOCAL_WORKSPACE_FOLDER:/src" git-secrets --pre_commit_hook'
237237
language: system
238238
```
239+
240+
## Run all releases
241+
242+
There are some scripts that can be used to trigger releases for all our repos.
243+
It is invoked by running `./scripts/run_all_release.sh`.
244+
This first authenticates to github using github cli tools to get a valid github token.
245+
246+
It then has an array of repos which it loops through asking for confirmation if you want to run deployment for it.
247+
248+
For any that you have answered yes to, it then calls the python script `scripts/trigger_release.py`.
249+
250+
The python script will trigger the release.yml workflow for that repo and monitor the the run for it.
251+
When it reaches one of the steps release_qa, release_ref, release_int it will approve release to that environment.
252+
Once the run reaches release_prod step, the python script will exit.
253+
The python script will also exit if the github run fails, or is cancelled at any step, or there is an unexpected response from github (eg user does not have permission to approve a deployment).
254+
When the python script finishes, it logs the run url, the tag and summary of what happened.
255+
Python logs go to the console, and to a timestamped file in the logs folder.
256+
257+
When all runs of the python script have finished then the shell script exits showing a summary of failed and successful runs.
258+
259+
260+
If a run fails on a step BEFORE the tag_release step, and the failure is transient (eg quality checks fails installing dependencies due to npm being down) then the whole release workflow can be rerun - either via this script or using the github website.
261+
262+
If a run fails on a step AFTER the tag_release step, and the failure is transient (eg regression tests failure) then that failing step can just be re-run manually via the github website.
263+
264+
If a run fails due to a code or cloudformation/cdk issue, then a new pull request should be created to fix this, merged to main, and a new release triggered.

0 commit comments

Comments
 (0)