Unverified Commit 4f0d0209 authored by Jeff Putsch's avatar Jeff Putsch Committed by GitHub

Add RHEL support to node feature. (#823)

* node feature working for RHEL and family, passing all tests

* RHEL support added

* fix linting error by removing debugging code.

* incorporate PR feedback

* address PR feedback

---------
Co-authored-by: 's avatarJeff Putsch <jputsch@analog.com>
parent 19d1edcb
...@@ -20,6 +20,8 @@ Alternatively, you can start up an interactive shell which will in turn source ` ...@@ -20,6 +20,8 @@ Alternatively, you can start up an interactive shell which will in turn source `
## OS Support ## OS Support
This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed. Debian/Ubuntu, RedHat Enterprise Linux, Fedora, Alma, and Rocky Linux distributions with the `apt`, `yum`, `dnf`, or `microdnf` package manager installed.
**Note**: RedHat 7 Family (RedHat, CentOS, etc.) must use Node versions less than 18 due to its system libraries and long-term support (LTS) policies.
`bash` is required to execute the `install.sh` script. `bash` is required to execute the `install.sh` script.
{ {
"id": "node", "id": "node",
"version": "1.3.1", "version": "1.4.0",
"name": "Node.js (via nvm), yarn and pnpm", "name": "Node.js (via nvm), yarn and pnpm",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/node", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/node",
"description": "Installs Node.js, nvm, yarn, pnpm, and needed dependencies.", "description": "Installs Node.js, nvm, yarn, pnpm, and needed dependencies.",
......
This diff is collapsed.
#!/bin/bash
set -e
# Optional: Import test library
source dev-container-features-test-lib
# Definition specific tests
check "version" node --version
check "pnpm" pnpm -v
check "nvm" bash -c ". /usr/local/share/nvm/nvm.sh && nvm install 10"
check "yarn" yarn --version
# Report result
reportResults
\ No newline at end of file
#!/bin/bash
set -e
# Optional: Import test library
source dev-container-features-test-lib
# Definition specific tests
check "version" node --version
check "pnpm" pnpm -v
check "nvm" bash -c ". /usr/local/share/nvm/nvm.sh && nvm install 10"
check "yarn" yarn --version
# Report result
reportResults
\ No newline at end of file
#!/bin/bash
set -e
# Optional: Import test library
source dev-container-features-test-lib
# Definition specific tests
check "version" node --version
check "pnpm" pnpm -v
check "nvm" bash -c ". /usr/local/share/nvm/nvm.sh && nvm install 10"
check "yarn" yarn --version
# Report result
reportResults
\ No newline at end of file
#!/bin/bash
set -e
# Optional: Import test library
source dev-container-features-test-lib
# Definition specific tests
check "version" node --version
check "pnpm" pnpm -v
check "nvm" bash -c ". /usr/local/share/nvm/nvm.sh && nvm install 10"
check "yarn" yarn --version
# Report result
reportResults
\ No newline at end of file
#!/bin/bash
set -e
# Optional: Import test library
source dev-container-features-test-lib
# Definition specific tests
check "version" node --version
check "pnpm" pnpm -v
check "nvm" bash -c ". /usr/local/share/nvm/nvm.sh && nvm install 10"
check "yarn" yarn --version
# Report result
reportResults
\ No newline at end of file
#!/bin/bash
set -e
# Optional: Import test library
source dev-container-features-test-lib
# Definition specific tests
check "version" node --version
check "pnpm" pnpm -v
check "nvm" bash -c ". /usr/local/share/nvm/nvm.sh && nvm install 10"
check "yarn" yarn --version
# Report result
reportResults
\ No newline at end of file
...@@ -5,11 +5,11 @@ set -e ...@@ -5,11 +5,11 @@ set -e
# Optional: Import test library # Optional: Import test library
source dev-container-features-test-lib source dev-container-features-test-lib
# 'lts' is some version of node 18 for a while. # 'lts' is now some version of node 20...
check "version_on_path" node -v | grep 18 check "version_on_path" node -v | grep 20
check "pnpm" pnpm -v check "pnpm" pnpm -v
check "v18_installed" ls -1 /usr/local/share/nvm/versions/node | grep 18 check "v20_installed" ls -1 /usr/local/share/nvm/versions/node | grep 20
check "v14_installed" ls -1 /usr/local/share/nvm/versions/node | grep 14.19.3 check "v14_installed" ls -1 /usr/local/share/nvm/versions/node | grep 14.19.3
check "v17_installed" ls -1 /usr/local/share/nvm/versions/node | grep 17.9.1 check "v17_installed" ls -1 /usr/local/share/nvm/versions/node | grep 17.9.1
......
#!/bin/bash
set -e
# Optional: Import test library
source dev-container-features-test-lib
# 'lts' is now some version of node 20...
check "version_on_path" node -v | grep 20
check "pnpm" pnpm -v
check "v20_installed" ls -1 /usr/local/share/nvm/versions/node | grep 20
check "v14_installed" ls -1 /usr/local/share/nvm/versions/node | grep 14.19.3
check "v17_installed" ls -1 /usr/local/share/nvm/versions/node | grep 17.9.1
# Report result
reportResults
#!/bin/bash
set -e
# Optional: Import test library
source dev-container-features-test-lib
# Definition specific tests
check "version" bash -c "node --version"
check "pnpm" pnpm -v
check "nvm version" bash -c ". /usr/local/share/nvm/nvm.sh && nvm --version | grep 0.39"
# Report result
reportResults
#!/bin/bash
set -e
# Optional: Import test library
source dev-container-features-test-lib
# Definition specific tests
check "version" node --version
check "pnpm" pnpm -v
# for some reason the "nvm" test switches the default node version on Mariner
# test yarn before that: it is only enabled in the default node version
check "yarn" yarn --version_list
check "nvm" bash -c ". /usr/local/share/nvm/nvm.sh && nvm install 10"
# Report result
reportResults
\ No newline at end of file
#!/bin/bash
set -e
# Optional: Import test library
source dev-container-features-test-lib
# Definition specific tests
check "version" node --version
check "pnpm" pnpm -v
check "nvm" bash -c ". /usr/local/share/nvm/nvm.sh && nvm install 10"
check "yarn" yarn --version
# Report result
reportResults
\ No newline at end of file
#!/bin/bash
set -e
# Optional: Import test library
source dev-container-features-test-lib
# Definition specific tests
check "version" node --version
check "pnpm" pnpm -v
check "nvm" bash -c ". /usr/local/share/nvm/nvm.sh && nvm install 10"
check "yarn" yarn --version
# Report result
reportResults
\ No newline at end of file
#!/bin/bash
set -e
# Optional: Import test library
source dev-container-features-test-lib
# Definition specific tests
check "version" node --version
check "pnpm" pnpm -v
check "nvm" bash -c ". /usr/local/share/nvm/nvm.sh && nvm install 10"
check "yarn" yarn --version
# Report result
reportResults
\ No newline at end of file
#!/bin/bash
set -e
# Optional: Import test library
source dev-container-features-test-lib
# Definition specific tests
check "version" node --version
check "pnpm" pnpm -v
check "nvm" bash -c ". /usr/local/share/nvm/nvm.sh && nvm install 10"
check "yarn" yarn --version
# Report result
reportResults
\ No newline at end of file
...@@ -8,6 +8,15 @@ ...@@ -8,6 +8,15 @@
} }
} }
}, },
"install_additional_node_on_rhel_family": {
"image": "almalinux:8",
"features": {
"node": {
"version": "lts",
"additionalVersions": "v17.9.1,v14.19.3"
}
}
},
"non_root_user": { "non_root_user": {
"image": "mcr.microsoft.com/devcontainers/base", "image": "mcr.microsoft.com/devcontainers/base",
"remoteUser": "vscode", "remoteUser": "vscode",
...@@ -28,6 +37,17 @@ ...@@ -28,6 +37,17 @@
} }
} }
}, },
"zsh_default_on_rhel_family": {
"image": "almalinux:8",
"features": {
"node": {
"version": "lts"
},
"common-utils": {
"configureZshAsDefaultShell": true
}
}
},
"version_none": { "version_none": {
"image": "mcr.microsoft.com/devcontainers/base", "image": "mcr.microsoft.com/devcontainers/base",
"remoteUser": "vscode", "remoteUser": "vscode",
...@@ -37,6 +57,15 @@ ...@@ -37,6 +57,15 @@
} }
} }
}, },
"version_none_on_rhel_family": {
"image": "mcr.microsoft.com/devcontainers/base",
"remoteUser": "vscode",
"features": {
"node": {
"version": "none"
}
}
},
"install_node_16_on_bionic": { "install_node_16_on_bionic": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-18.04", "image": "mcr.microsoft.com/devcontainers/base:ubuntu-18.04",
"features": { "features": {
...@@ -52,5 +81,101 @@ ...@@ -52,5 +81,101 @@
"nvmVersion": "0.39" "nvmVersion": "0.39"
} }
} }
},
"install_nvm_0.39_on_rhel_family": {
"image": "almalinux:8",
"features": {
"node": {
"nvmVersion": "0.39"
}
}
},
"centos-7": {
"image": "centos:centos7",
"features": {
"node": {
"version": "16"
}
}
},
"alma-8": {
"image": "almalinux:8",
"features": {
"node": {
"version": "lts"
}
}
},
"alma-8-minimal": {
"image": "almalinux:8-minimal",
"features": {
"node": {
"version": "lts"
}
}
},
"alma-9": {
"image": "almalinux:9",
"features": {
"node": {
"version": "lts"
}
}
},
"alma-9-minimal": {
"image": "almalinux:9-minimal",
"features": {
"node": {
"version": "lts"
}
}
},
"rocky-8": {
"image": "rockylinux:8",
"features": {
"node": {
"version": "lts"
}
}
},
"rocky-8-minimal": {
"image": "rockylinux:8-minimal",
"features": {
"node": {
"version": "lts"
}
}
},
"rocky-9": {
"image": "rockylinux:9",
"features": {
"node": {
"version": "lts"
}
}
},
"rocky-9-minimal": {
"image": "rockylinux:9-minimal",
"features": {
"node": {
"version": "lts"
}
}
},
"fedora": {
"image": "fedora",
"features": {
"node": {
"version": "lts"
}
}
},
"mariner": {
"image": "mcr.microsoft.com/cbl-mariner/base/core:2.0",
"features": {
"node": {
"version": "lts"
}
}
} }
} }
\ No newline at end of file
#!/bin/bash
set -e
# Optional: Import test library
source dev-container-features-test-lib
# Definition specific tests
check "nvm" bash -c ". /usr/local/share/nvm/nvm.sh && nvm install 10"
# Report result
reportResults
#!/bin/bash
set -e
# Optional: Import test library
source dev-container-features-test-lib
# Definition specific tests
check "nvm" bash -c ". /usr/local/share/nvm/nvm.sh && nvm install 10"
# Report result
reportResults
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment