-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
## Summary 🎫 [AEA-4069](https://nhsd-jira.digital.nhs.uk/browse/AEA-4069) Initial Pull Request - Routine Change - 🤖 Operational or Infrastructure Change - ✨ New Feature ### Details Initial Pull Request
- Loading branch information
1 parent
3479cbf
commit a797cb6
Showing
62 changed files
with
14,637 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ignore_checks: | ||
- W3002 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
FROM mcr.microsoft.com/devcontainers/base:ubuntu | ||
|
||
RUN apt-get update \ | ||
&& export DEBIAN_FRONTEND=noninteractive \ | ||
&& apt-get -y dist-upgrade \ | ||
&& apt-get -y install --no-install-recommends htop vim curl git build-essential \ | ||
libffi-dev libssl-dev libxml2-dev libxslt1-dev libjpeg8-dev libbz2-dev \ | ||
zlib1g-dev unixodbc unixodbc-dev libsecret-1-0 libsecret-1-dev libsqlite3-dev \ | ||
jq apt-transport-https ca-certificates gnupg-agent \ | ||
software-properties-common bash-completion python3-pip make libbz2-dev \ | ||
libreadline-dev libsqlite3-dev wget llvm libncurses5-dev libncursesw5-dev \ | ||
xz-utils tk-dev liblzma-dev netcat libyaml-dev | ||
|
||
# install aws stuff | ||
RUN wget -O /tmp/awscliv2.zip "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" && \ | ||
unzip /tmp/awscliv2.zip -d /tmp/aws-cli && \ | ||
/tmp/aws-cli/aws/install && \ | ||
rm tmp/awscliv2.zip && \ | ||
rm -rf /tmp/aws-cli | ||
|
||
USER vscode | ||
|
||
# Install ASDF | ||
RUN git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.11.3; \ | ||
echo '. $HOME/.asdf/asdf.sh' >> ~/.bashrc; \ | ||
echo '. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc; \ | ||
echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc; \ | ||
echo 'export GEM_HOME="$HOME/gems"' >> ~/.bashrc; \ | ||
echo 'export PATH="$HOME/gems/bin:$PATH"' >> ~/.bashrc; | ||
|
||
ENV PATH="$PATH:/home/vscode/.asdf/bin/:/workspaces/eps-aws-dashboards/node_modules/.bin" | ||
|
||
|
||
# Install ASDF plugins | ||
RUN asdf plugin add python; \ | ||
asdf plugin add poetry https://github.com/asdf-community/asdf-poetry.git; \ | ||
asdf plugin add shellcheck https://github.com/luizm/asdf-shellcheck.git; \ | ||
asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git; \ | ||
asdf plugin add direnv; \ | ||
asdf plugin add actionlint; \ | ||
asdf plugin add ruby https://github.com/asdf-vm/asdf-ruby.git | ||
|
||
|
||
WORKDIR /workspaces/eps-aws-dashboards | ||
ADD .tool-versions /workspaces/eps-aws-dashboards/.tool-versions | ||
ADD .tool-versions /home/vscode/.tool-versions | ||
|
||
RUN asdf install; \ | ||
asdf reshim python; \ | ||
asdf reshim poetry; \ | ||
asdf reshim nodejs; \ | ||
asdf direnv setup --shell bash --version 2.32.2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu | ||
{ | ||
"name": "Ubuntu", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"context": "..", | ||
"args": {} | ||
}, | ||
"mounts": [ | ||
"source=${env:HOME}${env:USERPROFILE}/.aws,target=/home/vscode/.aws,type=bind", | ||
"source=${env:HOME}${env:USERPROFILE}/.ssh,target=/home/vscode/.ssh,type=bind", | ||
"source=${env:HOME}${env:USERPROFILE}/.gnupg,target=/home/vscode/.gnupg,type=bind", | ||
"source=${env:HOME}${env:USERPROFILE}/.npmrc,target=/home/vscode/.npmrc,type=bind" | ||
], | ||
"features": { | ||
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": { | ||
"version": "latest", | ||
"moby": "true", | ||
"installDockerBuildx": "true" | ||
} | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"AmazonWebServices.aws-toolkit-vscode", | ||
"redhat.vscode-yaml", | ||
"ms-python.python", | ||
"ms-python.flake8", | ||
"eamodio.gitlens", | ||
"github.vscode-pull-request-github", | ||
"orta.vscode-jest", | ||
"42crunch.vscode-openapi", | ||
"mermade.openapi-lint", | ||
"christian-kohler.npm-intellisense", | ||
"dbaeumer.vscode-eslint", | ||
"lfm.vscode-makefile-term", | ||
"GrapeCity.gc-excelviewer", | ||
"redhat.vscode-xml", | ||
"streetsidesoftware.code-spell-checker", | ||
"timonwong.shellcheck", | ||
"mkhl.direnv", | ||
"github.vscode-github-actions" | ||
], | ||
"settings": { | ||
"python.defaultInterpreterPath": "/workspaces/eps-aws-dashboards/.venv/bin/python", | ||
"python.analysis.autoSearchPaths": true, | ||
"python.analysis.extraPaths": [], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true, | ||
"pylint.enabled": false, | ||
"python.linting.flake8Enabled": true, | ||
"python.linting.enabled": true, // required to format on save | ||
"editor.formatOnPaste": false, // required | ||
"editor.formatOnType": false, // required | ||
"editor.formatOnSave": true, // optional | ||
"editor.formatOnSaveMode": "file", | ||
"cSpell.words": ["fhir", "Formik", "pino", "serialisation"], | ||
"editor.defaultFormatter": "dbaeumer.vscode-eslint" | ||
|
||
} | ||
} | ||
}, | ||
"postCreateCommand": "rm -f ~/.docker/config.json; git config --global --add safe.directory /workspaces/eps-aws-dashboards; make install; direnv allow ." | ||
// "features": {}, | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "" | ||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: "Create confluence release notes" | ||
description: "Do release note actions in confluence and jira" | ||
inputs: | ||
RELEASE_TAG: | ||
required: false | ||
description: "The tag we are marking as released in jira" | ||
DEV_CLOUD_FORMATION_EXECUTE_LAMBDA_ROLE: | ||
required: true | ||
description: "The role to assume to execute the release notes lambda" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: connect to dev account | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-region: eu-west-2 | ||
role-to-assume: ${{ inputs.DEV_CLOUD_FORMATION_EXECUTE_LAMBDA_ROLE }} | ||
role-session-name: account-resources-release-notes-run-lambda | ||
|
||
- name: call markJiraReleased lambda | ||
shell: bash | ||
working-directory: .github/scripts | ||
env: | ||
RELEASE_TAG: ${{ inputs.RELEASE_TAG }} | ||
run: ./call_mark_jira_released.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
name: "Create confluence release notes" | ||
description: "Do release note actions in confluence and jira" | ||
inputs: | ||
TARGET_ENVIRONMENT: | ||
required: true | ||
description: "Target Environment" | ||
RELEASE_TAG: | ||
required: false | ||
description: "The tag we are releasing - only used for create_rc_release_notes" | ||
CONFLUENCE_PAGE_ID: | ||
required: true | ||
description: "The id of confluence page to update or create under" | ||
CREATE_RC_RELEASE_NOTES: | ||
required: true | ||
description: "whether to create rc release notes page instead of normal release notes" | ||
default: "false" | ||
DEV_CLOUD_FORMATION_EXECUTE_LAMBDA_ROLE: | ||
required: true | ||
description: "The role to assume to execute the release notes lambda" | ||
DEV_CLOUD_FORMATION_CHECK_VERSION_ROLE: | ||
required: true | ||
description: "The dev cloud formation deploy role" | ||
TARGET_CLOUD_FORMATION_CHECK_VERSION_ROLE: | ||
required: true | ||
description: "The target cloud formation deploy role" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: connect to target account | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-region: eu-west-2 | ||
role-to-assume: ${{ inputs.TARGET_CLOUD_FORMATION_CHECK_VERSION_ROLE }} | ||
role-session-name: account-resources-release-notes-target | ||
|
||
- name: Get deployed tag on target | ||
shell: bash | ||
working-directory: .github/scripts | ||
env: | ||
TARGET_ENVIRONMENT: ${{ inputs.TARGET_ENVIRONMENT }} | ||
run: ./get_target_deployed_tag.sh | ||
|
||
- name: connect to dev account | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-region: eu-west-2 | ||
role-to-assume: ${{ inputs.DEV_CLOUD_FORMATION_CHECK_VERSION_ROLE }} | ||
role-session-name: account-resources-release-notes-dev | ||
|
||
- name: get current dev tag | ||
shell: bash | ||
working-directory: .github/scripts | ||
run: ./get_current_dev_tag.sh | ||
|
||
- name: connect to dev account to run release notes lambda | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-region: eu-west-2 | ||
role-to-assume: ${{ inputs.DEV_CLOUD_FORMATION_EXECUTE_LAMBDA_ROLE }} | ||
role-session-name: account-resources-release-notes-run-lambda | ||
unset-current-credentials: true | ||
|
||
- name: create int release notes | ||
shell: bash | ||
working-directory: .github/scripts | ||
if: inputs.TARGET_ENVIRONMENT == 'int' && inputs.CREATE_RC_RELEASE_NOTES == 'false' | ||
env: | ||
ENV: INT | ||
PAGE_ID: ${{ inputs.CONFLUENCE_PAGE_ID }} | ||
run: ./create_env_release_notes.sh | ||
|
||
- name: create int rc release notes | ||
shell: bash | ||
working-directory: .github/scripts | ||
if: inputs.TARGET_ENVIRONMENT == 'int' && inputs.CREATE_RC_RELEASE_NOTES == 'true' | ||
env: | ||
RELEASE_TAG: ${{ inputs.RELEASE_TAG }} | ||
PAGE_ID: ${{ inputs.CONFLUENCE_PAGE_ID }} | ||
run: ./create_int_rc_release_notes.sh | ||
|
||
- name: create prod release notes | ||
shell: bash | ||
working-directory: .github/scripts | ||
if: inputs.TARGET_ENVIRONMENT == 'prod' | ||
env: | ||
ENV: PROD | ||
PAGE_ID: ${{ inputs.CONFLUENCE_PAGE_ID }} | ||
run: ./create_env_release_notes.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
######################################################################### | ||
# Dependabot configuration file | ||
######################################################################### | ||
|
||
version: 2 | ||
|
||
updates: | ||
- package-ecosystem: "github-actions" | ||
# Workflow files stored in the | ||
# default location of `.github/workflows` | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
commit-message: | ||
prefix: "Upgrade: [dependabot] - " | ||
|
||
################################### | ||
# NPM workspace ################## | ||
################################### | ||
- package-ecosystem: "npm" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
versioning-strategy: increase | ||
commit-message: | ||
prefix: "Upgrade: [dependabot] - " | ||
|
||
################################### | ||
# Poetry ######################### | ||
################################### | ||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
versioning-strategy: increase | ||
commit-message: | ||
prefix: "Upgrade: [dependabot] - " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
## Summary | ||
|
||
**Remove items from this list if they are not relevant. Remove this line once this has been done** | ||
|
||
- Routine Change | ||
- :exclamation: Breaking Change | ||
- :robot: Operational or Infrastructure Change | ||
- :sparkles: New Feature | ||
- :warning: Potential issues that might be caused by this change | ||
|
||
### Details | ||
|
||
Add any summary information of what is in the change. **Remove this line if you have nothing to add.** | ||
|
||
## Pull Request Naming | ||
|
||
Pull requests should be named using the following format: | ||
|
||
```text | ||
Tag: [AEA-NNNN] - Short description | ||
``` | ||
|
||
Tag can be one of: | ||
|
||
- `Fix` - for a bug fix. (Patch release) | ||
- `Update` - either for a backwards-compatible enhancement or for a rule change that adds reported problems. (Patch release) | ||
- `New` - implemented a new feature. (Minor release) | ||
- `Breaking` - for a backwards-incompatible enhancement or feature. (Major release) | ||
- `Docs` - changes to documentation only. (Patch release) | ||
- `Build` - changes to build process only. (No release) | ||
- `Upgrade` - for a dependency upgrade. (Patch release) | ||
- `Chore` - for refactoring, adding tests, etc. (anything that isn't user-facing). (Patch release) | ||
|
||
If the current release is x.y.z then | ||
- a patch release increases z by 1 | ||
- a minor release increases y by 1 | ||
- a major release increases x by 1 | ||
|
||
Correct tagging is necessary for our automated versioning and release process. | ||
|
||
The description of your pull request will be used as the commit message for the merge, and also be included in the changelog. Please ensure that your title is sufficiently descriptive. | ||
|
||
### Rerunning Checks | ||
|
||
If you need to rename your pull request, you can restart the checks by either: | ||
|
||
- Closing and reopening the pull request | ||
- pushing an empty commit | ||
```bash | ||
git commit --allow-empty -m 'trigger build' | ||
git push | ||
``` | ||
- Amend your last commit and force push to the branch | ||
```bash | ||
git commit --amend --no-edit | ||
git push --force | ||
``` | ||
|
||
Rerunning the checks from within the pull request will not use the updated title. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "calling mark jira released" | ||
|
||
cat <<EOF > payload.json | ||
{ | ||
"releaseVersion": "Dashboards-$RELEASE_TAG" | ||
} | ||
EOF | ||
cat payload.json | ||
|
||
function_arn=$(aws cloudformation list-exports --query "Exports[?Name=='release-notes:MarkJiraReleasedLambdaArn'].Value" --output text) | ||
aws lambda invoke --function-name "${function_arn}" --cli-binary-format raw-in-base64-out --payload file://payload.json out.txt | ||
cat out.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
cat <<EOF > payload.json | ||
{ | ||
"currentTag": "$CURRENT_DEPLOYED_TAG", | ||
"targetTag": "$DEV_TAG", | ||
"repoName": "eps-aws-dashboards", | ||
"targetEnvironment": "$ENV", | ||
"productName": "EPS AWS Dashboards", | ||
"releaseNotesPageId": "$PAGE_ID", | ||
"releaseNotesPageTitle": "Current EPS AWS Dashboards release notes - $ENV" | ||
} | ||
EOF | ||
cat payload.json | ||
|
||
function_arn=$(aws cloudformation list-exports --query "Exports[?Name=='release-notes:CreateReleaseNotesLambdaArn'].Value" --output text) | ||
aws lambda invoke --function-name "${function_arn}" --cli-binary-format raw-in-base64-out --payload file://payload.json out.txt | ||
cat out.txt |
Oops, something went wrong.