Skip to content

Commit 07c4394

Browse files
authored
Merge branch 'main' into user-guide
2 parents d82cd2e + 74221c4 commit 07c4394

39 files changed

+202
-69
lines changed

.devcontainer/devcontainer.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"name": "devcontainer-community",
3-
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
3+
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04",
44
"features": {
55
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
66
"ghcr.io/devcontainers/features/node:1": {}
77
},
8+
"postCreateCommand": "npm install --global @devcontainers/cli",
89
"customizations": {
910
"vscode": {
1011
"extensions": [
@@ -18,6 +19,5 @@
1819
}
1920
}
2021
}
21-
},
22-
"postCreateCommand": "npm install --global @devcontainers/cli"
22+
}
2323
}

.github/workflows/dependency-review.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
steps:
2323
- name: Checkout
2424
id: checkout
25-
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
25+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
2626

2727
- name: Dependency Review
2828
id: dependency_review
29-
uses: actions/dependency-review-action@0c155c5e8556a497adf53f2c18edabf945ed8e70 # v4.3.2
29+
uses: actions/dependency-review-action@72eb03d02c7872a771aacd928f3123ac62ad6d3a # v4.3.3
3030
with:
3131
fail-on-severity: critical

.github/workflows/features.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
steps:
2727
- name: Checkout
2828
id: checkout
29-
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
29+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
3030

3131
- name: Build path-filters file
3232
id: build_path_filters
@@ -54,7 +54,7 @@ jobs:
5454
steps:
5555
- name: Checkout
5656
id: checkout
57-
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
57+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
5858

5959
- name: Check Version
6060
id: check_version
@@ -142,15 +142,15 @@ jobs:
142142
steps:
143143
- name: Checkout
144144
id: checkout
145-
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
145+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
146146

147147
- name: Install @devcontainers/cli
148148
id: install_devcontainers_cli
149149
run: npm install --global @devcontainers/cli@latest
150150

151151
- name: Build Image
152152
id: build_image
153-
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
153+
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
154154
with:
155155
file: images/base/Dockerfile
156156
context: images/base
@@ -187,7 +187,7 @@ jobs:
187187
steps:
188188
- name: Checkout
189189
id: checkout
190-
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
190+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
191191

192192
- name: Validate
193193
uses: devcontainers/action@528049dce833673f136ddfc09c2720d450029a6b # v1.4.2
@@ -211,11 +211,11 @@ jobs:
211211
steps:
212212
- name: Checkout
213213
id: checkout
214-
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
214+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
215215

216216
- name: Log in to GitHub Container Registry
217217
id: login_ghcr
218-
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
218+
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
219219
with:
220220
registry: ghcr.io
221221
username: ${{ github.actor }}

.github/workflows/images.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
steps:
2727
- name: Checkout
2828
id: checkout
29-
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
29+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
3030

3131
- name: Build path-filters file
3232
id: build_path_filters
@@ -54,7 +54,7 @@ jobs:
5454
steps:
5555
- name: Checkout
5656
id: checkout
57-
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
57+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
5858

5959
- name: Check Version
6060
id: check_version
@@ -143,11 +143,11 @@ jobs:
143143
steps:
144144
- name: Checkout
145145
id: checkout
146-
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
146+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
147147

148148
- name: Set Up Container Structure Test
149149
id: setup_container_structure_test
150-
uses: ministryofjustice/github-actions/setup-container-structure-test@11e78e36ac2cab791b02824fc528885199bf88a1 # v18.0.0
150+
uses: ministryofjustice/github-actions/setup-container-structure-test@c9cb317b93b19d1c28b7a42b0c982bdff8106bbb # v18.0.1
151151

152152
- name: Set Up QEMU
153153
id: setup_qemu
@@ -158,7 +158,7 @@ jobs:
158158
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
159159

160160
- name: Build Image
161-
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
161+
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
162162
with:
163163
file: images/${{ matrix.image }}/Dockerfile
164164
context: images/${{ matrix.image }}
@@ -176,7 +176,7 @@ jobs:
176176
177177
- name: Scan Image
178178
id: scan_image
179-
uses: aquasecurity/trivy-action@b2933f565dbc598b29947660e66259e3c7bc8561 # 0.20.0
179+
uses: aquasecurity/trivy-action@595be6a0f6560a0a8fc419ddf630567fc623531d # 0.22.0
180180
with:
181181
scan-type: image
182182
image-ref: ghcr.io/ministryofjustice/devcontainer-${{ matrix.image }}:${{ github.sha }}
@@ -201,7 +201,7 @@ jobs:
201201
steps:
202202
- name: Checkout
203203
id: checkout
204-
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
204+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
205205

206206
- name: Set Up QEMU
207207
id: setup_qemu
@@ -213,7 +213,7 @@ jobs:
213213

214214
- name: Log in to GitHub Container Registry
215215
id: login_ghcr
216-
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
216+
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
217217
with:
218218
registry: ghcr.io
219219
username: ${{ github.actor }}
@@ -226,7 +226,7 @@ jobs:
226226
echo "version=${version}" >>"${GITHUB_ENV}"
227227
228228
- name: Publish Image
229-
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
229+
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
230230
with:
231231
file: images/${{ matrix.image }}/Dockerfile
232232
context: images/${{ matrix.image }}

.github/workflows/super-linter.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ jobs:
2323
steps:
2424
- name: Checkout
2525
id: checkout
26-
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
26+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
2727
with:
2828
fetch-depth: 0
2929

3030
- name: Super-Linter
3131
id: super_linter
32-
uses: super-linter/super-linter/slim@56576d491db07c7236b445ab09991ca49d12b0c6 # v6.5.0
32+
uses: super-linter/super-linter/slim@88ea3923a7e1f89dd485d079f6eb5f5e8f937589 # v6.6.0
3333
env:
3434
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3535
DEFAULT_BRANCH: main

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ coverage/
44
venv/
55
env/
66
.DS_STORE
7-
.vscode
87
*.code-workspace
98
*.sha256
109
terraform.tfstate

.vscode/launch.json

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Feature Test",
6+
"type": "node",
7+
"request": "launch",
8+
"runtimeExecutable": "bash",
9+
"runtimeArgs": ["${workspaceFolder}/scripts/features/test.sh", "${input:feature}"],
10+
"console": "integratedTerminal"
11+
},
12+
{
13+
"name": "Image Test",
14+
"type": "node",
15+
"request": "launch",
16+
"runtimeExecutable": "bash",
17+
"runtimeArgs": ["${workspaceFolder}/scripts/images/build-and-test.sh", "${input:image}"],
18+
"console": "integratedTerminal"
19+
}
20+
],
21+
"inputs": [
22+
{
23+
"id": "feature",
24+
"type": "pickString",
25+
"description": "Select the feature to test",
26+
"options": ["aws", "cloud-platform", "container-structure-test", "kubernetes", "static-analysis", "terraform"]
27+
},
28+
{
29+
"id": "image",
30+
"type": "pickString",
31+
"description": "Select the image to test",
32+
"options": ["base"]
33+
}
34+
]
35+
}

features/src/aws/CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
## [Unreleased]
1010

11+
## [1.0.0] - 2024-05-13
12+
13+
- Promoting to 1.0.0
14+
15+
- Added AWS SSO CLI completion
16+
17+
### Changed
18+
1119
## [0.0.3] - 2024-04-08
1220

1321
### Changed
+15-2
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,31 @@
11
{
22
"id": "aws",
3-
"version": "0.0.3",
3+
"version": "1.0.0",
44
"name": "AWS",
5+
"documentationURL": "https://github.com/ministryofjustice/.devcontainer/tree/main/features/src/aws",
56
"description": "Installs the AWS CLI and AWS SSO CLI",
67
"options": {
78
"awsCliVersion": {
89
"type": "string",
910
"description": "Version of the AWS CLI to install",
11+
"proposals": ["latest"],
1012
"default": "latest"
1113
},
1214
"awsSsoCliVersion": {
1315
"type": "string",
14-
"description": "Version of AWS SSO CLI to install",
16+
"description": "Version of the AWS SSO CLI to install",
17+
"proposals": ["latest"],
1518
"default": "latest"
19+
},
20+
"installAwsSsoCliPrompt": {
21+
"type": "boolean",
22+
"description": "Whether to install the AWS SSO CLI prompt",
23+
"default": true
24+
}
25+
},
26+
"customizations": {
27+
"vscode": {
28+
"extensions": ["AmazonWebServices.aws-toolkit-vscode"]
1629
}
1730
}
1831
}

features/src/aws/install-aws-cli.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ unzip "${ARTEFACT}"
2323

2424
bash ./aws/install
2525

26-
rm --recursive --force aws "${ARTEFACT}"
26+
install --owner=vscode --group=vscode --mode=775 "$(dirname "${0}")"/src/home/vscode/.devcontainer/featurerc.d/aws-cli.sh /home/vscode/.devcontainer/featurerc.d/aws-cli.sh
2727

28-
install --owner=vscode --group=vscode --mode=775 "$(dirname "${0}")"/src/home/vscode/.devcontainer/featurerc.d/aws.sh /home/vscode/.devcontainer/featurerc.d/aws.sh
28+
rm --recursive --force aws "${ARTEFACT}"

features/src/aws/install-aws-sso-cli.sh

+11-4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ get_system_architecture
1010

1111
GITHUB_REPOSITORY="synfinatic/aws-sso-cli"
1212
VERSION="${AWSVAULTVERSION:-"latest"}"
13+
INSTALL_PROMPT="${INSTALLAWSSSOCLIPROMPT:-"true"}"
1314

1415
if [[ "${VERSION}" == "latest" ]]; then
1516
get_github_latest_tag "${GITHUB_REPOSITORY}"
@@ -29,11 +30,17 @@ install --directory --owner=vscode --group=vscode /home/vscode/.aws-sso
2930

3031
install --owner=vscode --group=vscode --mode=775 "$(dirname "${0}")"/src/home/vscode/.aws-sso/config.yaml /home/vscode/.aws-sso/config.yaml
3132

32-
install --owner=vscode --group=vscode --mode=775 "$(dirname "${0}")"/src/home/vscode/.devcontainer/featurerc.d/aws-sso.sh /home/vscode/.devcontainer/featurerc.d/aws-sso.sh
33+
install --owner=vscode --group=vscode --mode=775 "$(dirname "${0}")"/src/home/vscode/.devcontainer/featurerc.d/aws-sso-cli.sh /home/vscode/.devcontainer/featurerc.d/aws-sso-cli.sh
3334

34-
install --owner=vscode --group=vscode --mode=775 "$(dirname "${0}")"/src/home/vscode/.devcontainer/promptrc.d/aws-sso.sh /home/vscode/.devcontainer/promptrc.d/aws-sso.sh
35+
if [[ "${INSTALL_PROMPT}" == "true" ]]; then
36+
install --owner=vscode --group=vscode --mode=775 "$(dirname "${0}")"/src/home/vscode/.devcontainer/promptrc.d/aws-sso-cli.sh /home/vscode/.devcontainer/promptrc.d/aws-sso-cli.sh
37+
fi
3538

36-
awsSsoFilePassword=$(openssl rand -base64 48 | tr -dc 'a-zA-Z0-9' | cut -c -32)
39+
awsSsoFilePassword=$(openssl rand -hex 32)
3740
export awsSsoFilePassword
3841

39-
sed --in-place "s/REPLACE_ME/${awsSsoFilePassword}/g" /home/vscode/.devcontainer/featurerc.d/aws-sso.sh
42+
sed --in-place "s/REPLACE_ME/${awsSsoFilePassword}/g" /home/vscode/.devcontainer/featurerc.d/aws-sso-cli.sh
43+
44+
aws-sso --config /home/vscode/.aws-sso/config.yaml completions --source --shell=zsh >>/home/vscode/.devcontainer/featurerc.d/aws-sso-cli.sh
45+
46+
rm --force aws-sso

features/src/container-structure-test/CHANGELOG.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- markdownlint-disable MD003 -->
1+
<!-- markdownlint-disable MD003 MD024 -->
22
# Changelog
33

44
All notable changes to this project will be documented in this file.
@@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
## [Unreleased]
1010

11+
## [1.0.0] - 2024-05-13
12+
13+
### Changed
14+
15+
- Promoting to 1.0.0
16+
1117
## [0.0.2] - 2024-04-05
1218

1319
## Changed

features/src/container-structure-test/devcontainer-feature.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"id": "container-structure-test",
3-
"version": "0.0.2",
3+
"version": "1.0.0",
44
"name": "Container Structure Test",
5-
"description": "Installs Container Structure Test",
5+
"description": "Installs the Container Structure Test CLI",
66
"options": {
7-
"containerStructureTestVersion": {
7+
"containerStructureTestCliVersion": {
88
"type": "string",
9-
"description": "Version of Container Structure Test to install",
9+
"description": "Version of Container Structure Test CLI to install",
10+
"proposals": ["latest"],
1011
"default": "latest"
1112
}
1213
},

features/src/container-structure-test/install-container-structure-test.sh features/src/container-structure-test/install-container-structure-test-cli.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ source /usr/local/bin/devcontainer-utils
99
get_system_architecture
1010

1111
GITHUB_REPOSITORY="GoogleContainerTools/container-structure-test"
12-
VERSION="${CONTAINERSTRUCTURETESTVERSION:-"latest"}"
12+
VERSION="${CONTAINERSTRUCTURETESTCLIVERSION:-"latest"}"
1313

1414
if [[ "${VERSION}" == "latest" ]]; then
1515
get_github_latest_tag "${GITHUB_REPOSITORY}"
@@ -25,4 +25,6 @@ curl --fail-with-body --location "https://github.com/${GITHUB_REPOSITORY}/releas
2525

2626
install --owner=vscode --group=vscode --mode=775 container-structure-test /usr/local/bin/container-structure-test
2727

28+
container-structure-test completion zsh >>/home/vscode/.devcontainer/featurerc.d/container-structure-test-cli.sh
29+
2830
rm --force container-structure-test

features/src/container-structure-test/install.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
# file not accessible until being built
55
source /usr/local/bin/devcontainer-utils
66

7-
logger "info" "Installing Container Structure Test (version: ${CONTAINERSTRUCTURETESTVERSION})"
8-
bash "$(dirname "${0}")"/install-container-structure-test.sh
7+
logger "info" "Installing Container Structure Test CLI (version: ${CONTAINERSTRUCTURETESTCLIVERSION})"
8+
bash "$(dirname "${0}")"/install-container-structure-test-cli.sh

0 commit comments

Comments
 (0)