Skip to content

Commit 7747ccf

Browse files
authored
[node] - Fixing issue due to expired GPG key for yarn. (#1546)
* [node] - Fixing issue due to expised GPG key for yarn. * Changing back to debian 11 * Fixing failing tests * Trigger test again
1 parent a5448c0 commit 7747ccf

7 files changed

Lines changed: 68 additions & 12 deletions

src/node/devcontainer-feature.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "node",
3-
"version": "1.6.3",
4-
"name": "Node.js (via nvm), yarn and pnpm",
3+
"version": "1.6.4",
4+
"name": "Node.js (via nvm), yarn and pnpm.",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/node",
66
"description": "Installs Node.js, nvm, yarn, pnpm, and needed dependencies.",
77
"options": {

src/node/install.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,15 @@ install_yarn() {
203203
# via apt-get on Debian systems
204204
if ! type yarn >/dev/null 2>&1; then
205205
# Import key safely (new method rather than deprecated apt-key approach) and install
206-
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarn-archive-keyring.gpg
207-
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/yarn-archive-keyring.gpg] https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list
206+
if [ "${VERSION_CODENAME}" = "trixie" ]; then
207+
# Trixie requires fetching the key from keys.openpgp.org
208+
mkdir -p /etc/apt/keyrings
209+
curl -fsSL "https://keys.openpgp.org/vks/v1/by-fingerprint/72ECF46A56B4AD39C907BBB71646B01B86E50310" | gpg --dearmor --yes -o /etc/apt/keyrings/yarn-archive-keyring.gpg
210+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/yarn-archive-keyring.gpg] https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list
211+
else
212+
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarn-archive-keyring.gpg
213+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/yarn-archive-keyring.gpg] https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list
214+
fi
208215
apt-get update
209216
apt-get -y install --no-install-recommends yarn
210217
else

test/node/install_additional_node.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ set -e
66
source dev-container-features-test-lib
77

88
# 'lts' is now some version of node 22...
9-
check "version_on_path" node -v | grep 22
9+
check "version_on_path" bash -c "node -v | grep 24"
1010
check "pnpm" bash -c "pnpm -v | grep 8.8.0"
1111

12-
check "v20_installed" ls -1 /usr/local/share/nvm/versions/node | grep 20.19.1
13-
check "v19_installed" ls -1 /usr/local/share/nvm/versions/node | grep 19.9.0
12+
check "v20_installed" bash -c "ls -1 /usr/local/share/nvm/versions/node | grep 20.19.1"
13+
check "v19_installed" bash -c "ls -1 /usr/local/share/nvm/versions/node | grep 19.9.0"
1414

1515

1616
# Report result
17-
reportResults
17+
reportResults

test/node/install_additional_node_on_rhel_family.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ set -e
66
source dev-container-features-test-lib
77

88
# 'lts' is now some version of node 22...
9-
check "version_on_path" node -v | grep 22
9+
check "version_on_path" bash -c "node -v | grep 24"
1010
check "pnpm" bash -c "pnpm -v | grep 6.16.0"
1111

12-
check "v20_installed" ls -1 /usr/local/share/nvm/versions/node | grep 20
13-
check "v19_installed" ls -1 /usr/local/share/nvm/versions/node | grep 19.9.0
14-
check "v20_installed" ls -1 /usr/local/share/nvm/versions/node | grep 20.19.1
12+
check "v19_installed" bash -c "ls -1 /usr/local/share/nvm/versions/node | grep 19.9.0"
13+
check "v20_installed" bash -c "ls -1 /usr/local/share/nvm/versions/node | grep 20.19.1"
1514

1615

1716
# Report result
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Optional: Import test library
6+
source dev-container-features-test-lib
7+
8+
# Definition specific tests
9+
check "version" node --version
10+
check "pnpm" pnpm -v
11+
check "nvm" bash -c ". /usr/local/share/nvm/nvm.sh && nvm install 10"
12+
check "yarn" yarn --version
13+
14+
# Report result
15+
reportResults
16+
17+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Optional: Import test library
6+
source dev-container-features-test-lib
7+
8+
# Definition specific tests
9+
check "version" node --version
10+
check "pnpm" pnpm -v
11+
check "nvm" bash -c ". /usr/local/share/nvm/nvm.sh && nvm install 10"
12+
check "yarn" yarn --version
13+
14+
# Report result
15+
reportResults
16+
17+

test/node/scenarios.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
{
2+
"install_node_debian_trixie": {
3+
"image": "debian:13",
4+
"features": {
5+
"node": {
6+
"version": "lts"
7+
}
8+
}
9+
},
10+
"install_node_debian_bookworm": {
11+
"image": "debian:12",
12+
"features": {
13+
"node": {
14+
"version": "lts"
15+
}
16+
}
17+
},
218
"nvm_test_fallback": {
319
"image": "debian:11",
420
"features": {

0 commit comments

Comments
 (0)