Skip to content

Commit a8d306b

Browse files
committed
new one
1 parent 97767c6 commit a8d306b

5 files changed

Lines changed: 30 additions & 37 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
ARG IMAGE_VERSION=latest
2-
FROM ghcr.io/nhsdigital/eps-devcontainers/node_24_python_3_14:${IMAGE_VERSION}
2+
ARG IMAGE=node_24_python_3_14
3+
FROM ghcr.io/nhsdigital/eps-devcontainers/${IMAGE}:${IMAGE_VERSION}
34

45
USER root
56
# specify DOCKER_GID to force container docker group id to match host
@@ -12,4 +13,10 @@ RUN if [ -n "${DOCKER_GID}" ]; then \
1213
usermod -aG docker vscode; \
1314
fi
1415

16+
# fix vscode user back to 1000
17+
RUN usermod -u 1000 vscode; \
18+
groupmod -g 1000 vscode; \
19+
chown -R vscode:vscode /home/vscode
20+
21+
RUN rm -rf /home/vscode/.ssh
1522
USER vscode

.devcontainer/devcontainer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2-
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
31
{
42
"name": "Ubuntu",
5-
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
63
"build": {
74
"dockerfile": "Dockerfile",
85
"context": "..",
96
"args": {
107
"DOCKER_GID": "${env:DOCKER_GID:}",
11-
"IMAGE_VERSION": "v1.0.1" // This arg is used in the Dockerfile to specify the base image version }
8+
"IMAGE_VERSION": "pr-16-69b4bfb",
9+
"IMAGE": "node_24_python_3_14"
1210
},
11+
"postAttachCommand": "git-secrets --register-aws; git-secrets --add-provider -- cat /usr/share/secrets-scanner/nhsd-rules-deny.txt",
1312
"mounts": [
1413
"source=${env:HOME}${env:USERPROFILE}/.aws,target=/home/vscode/.aws,type=bind",
1514
"source=${env:HOME}${env:USERPROFILE}/.ssh,target=/home/vscode/.ssh,type=bind",
@@ -43,3 +42,4 @@
4342
}
4443
}
4544
}
45+
}

.github/workflows/pull_request.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ jobs:
1616
AUTOMERGE_PEM: ${{ secrets.AUTOMERGE_PEM }}
1717
pr_title_format_check:
1818
uses: ./.github/workflows/pr_title_check.yml
19-
get_asdf_version:
19+
get_config_values:
2020
runs-on: ubuntu-22.04
2121
outputs:
2222
asdf_version: ${{ steps.asdf-version.outputs.version }}
2323
tag_format: ${{ steps.load-config.outputs.TAG_FORMAT }}
24+
devcontainer_version: ${{ steps.load-config.outputs.DEVCONTAINER_VERSION }}
2425
steps:
2526
- name: Checkout code
2627
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
@@ -32,21 +33,22 @@ jobs:
3233
id: load-config
3334
run: |
3435
TAG_FORMAT=$(yq '.TAG_FORMAT' .github/config/settings.yml)
36+
DEVCONTAINER_VERSION=$(jq -r '.build.args.IMAGE_VERSION' .devcontainer/devcontainer.json)
3537
echo "TAG_FORMAT=$TAG_FORMAT" >> "$GITHUB_OUTPUT"
38+
echo "DEVCONTAINER_VERSION=$DEVCONTAINER_VERSION" >> "$GITHUB_OUTPUT"
3639
quality_checks:
3740
uses: ./.github/workflows/quality-checks.yml
38-
needs: [get_asdf_version]
41+
needs: [get_config_values]
3942
with:
40-
asdfVersion: ${{ needs.get_asdf_version.outputs.asdf_version }}
41-
runtime_docker_image: "ghcr.io/nhsdigital/eps-devcontainers/node_24_python_3_14:v1.0.1"
43+
runtime_docker_image: "ghcr.io/nhsdigital/eps-devcontainers/node_24_python_3_14:${{ needs.get_config_values.outputs.devcontainer_version }}"
4244
secrets:
4345
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4446
tag_release:
45-
needs: [quality_checks, get_asdf_version]
47+
needs: [quality_checks, get_config_values]
4648
uses: ./.github/workflows/tag-release.yml
4749
with:
4850
dry_run: true
49-
asdfVersion: ${{ needs.get_asdf_version.outputs.asdf_version }}
51+
asdfVersion: ${{ needs.get_config_values.outputs.asdf_version }}
5052
branch_name: ${{ github.event.pull_request.head.ref }}
51-
tag_format: ${{ needs.get_asdf_version.outputs.tag_format }}
53+
tag_format: ${{ needs.get_config_values.outputs.tag_format }}
5254
secrets: inherit

.github/workflows/quality-checks.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,11 @@ on:
66
SONAR_TOKEN:
77
required: false
88
inputs:
9-
install_java:
10-
type: boolean
11-
description: "If true, the action will install java into the runner, separately from ASDF."
12-
default: false
13-
required: false
149
run_sonar:
1510
type: boolean
1611
description: Toggle to run sonar code analyis on this repository.
1712
default: true
1813
required: false
19-
asdfVersion:
20-
type: string
21-
required: true
22-
reinstall_poetry:
23-
type: boolean
24-
description: Toggle to reinstall poetry on top of python version installed by asdf.
25-
default: false
2614
run_docker_scan:
2715
type: boolean
2816
description: Toggle to run docker vulnerability scan on this repository.
@@ -44,12 +32,6 @@ jobs:
4432
image: ${{ inputs.runtime_docker_image }}
4533
options: --user 1000:1000
4634
steps:
47-
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654
48-
if: ${{ inputs.install_java }}
49-
with:
50-
java-version: "21"
51-
distribution: "corretto"
52-
5335
- &checkout
5436
name: Checkout code
5537
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

.github/workflows/release.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ env:
88
BRANCH_NAME: ${{ github.event.ref.BRANCH_NAME }}
99

1010
jobs:
11-
get_asdf_version:
11+
get_config_values:
1212
runs-on: ubuntu-22.04
1313
outputs:
1414
asdf_version: ${{ steps.asdf-version.outputs.version }}
1515
tag_format: ${{ steps.load-config.outputs.TAG_FORMAT }}
16+
devcontainer_version: ${{ steps.load-config.outputs.DEVCONTAINER_VERSION }}
1617
steps:
1718
- name: Checkout code
1819
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
@@ -24,21 +25,22 @@ jobs:
2425
id: load-config
2526
run: |
2627
TAG_FORMAT=$(yq '.TAG_FORMAT' .github/config/settings.yml)
28+
DEVCONTAINER_VERSION=$(jq -r '.build.args.IMAGE_VERSION' .devcontainer/devcontainer.json)
2729
echo "TAG_FORMAT=$TAG_FORMAT" >> "$GITHUB_OUTPUT"
30+
echo "DEVCONTAINER_VERSION=$DEVCONTAINER_VERSION" >> "$GITHUB_OUTPUT"
2831
quality_checks:
29-
needs: [get_asdf_version]
32+
needs: [get_config_values]
3033
uses: ./.github/workflows/quality-checks.yml
3134
with:
32-
asdfVersion: ${{ needs.get_asdf_version.outputs.asdf_version }}
33-
runtime_docker_image: "ghcr.io/nhsdigital/eps-devcontainers/node_24_python_3_14:v1.0.1"
35+
runtime_docker_image: "ghcr.io/nhsdigital/eps-devcontainers/node_24_python_3_14:${{ needs.get_config_values.outputs.devcontainer_version }}"
3436
secrets:
3537
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
3638
tag_release:
37-
needs: [quality_checks, get_asdf_version]
39+
needs: [quality_checks, get_config_values]
3840
uses: ./.github/workflows/tag-release.yml
3941
with:
4042
dry_run: false
41-
asdfVersion: ${{ needs.get_asdf_version.outputs.asdf_version }}
43+
asdfVersion: ${{ needs.get_config_values.outputs.asdf_version }}
4244
branch_name: main
43-
tag_format: ${{ needs.get_asdf_version.outputs.tag_format }}
45+
tag_format: ${{ needs.get_config_values.outputs.tag_format }}
4446
secrets: inherit

0 commit comments

Comments
 (0)