File tree Expand file tree Collapse file tree 9 files changed +138
-6
lines changed Expand file tree Collapse file tree 9 files changed +138
-6
lines changed Original file line number Diff line number Diff line change 17
17
- bitwarden-cli
18
18
- bitwarden-secrets-manager
19
19
- mise
20
+ - mise-node
20
21
- mise-python
21
22
- vault
22
23
baseImage :
63
64
- bitwarden-secrets-manager
64
65
- kamal
65
66
- mise
67
+ - mise-node
66
68
- mise-python
67
69
- vault
68
70
steps :
Original file line number Diff line number Diff line change
1
+
2
+ # Node.js (mise) (mise-node)
3
+
4
+ Installs Node.js via mise-en-place version manager.
5
+
6
+ ## Example Usage
7
+
8
+ ``` json
9
+ "features" : {
10
+ "ghcr.io/RouL/devcontainer-features/mise-node:1" : {}
11
+ }
12
+ ```
13
+
14
+ ## Options
15
+
16
+ | Options Id | Description | Type | Default Value |
17
+ | -----| -----| -----| -----|
18
+ | version | Version to be installed as default. | string | lts |
19
+ | extra_versions | Additional versions to be installed. (space separated) | string | - |
20
+
21
+
22
+
23
+ ---
24
+
25
+ _ Note: This file was auto-generated from the [ devcontainer-feature.json] ( https://github.com/RouL/devcontainer-features/blob/main/src/mise-node/devcontainer-feature.json ) . Add additional notes to a ` NOTES.md ` ._
Original file line number Diff line number Diff line change
1
+ {
2
+ "id" : " mise-node" ,
3
+ "version" : " 1.0.0" ,
4
+ "name" : " Node.js (mise)" ,
5
+ "description" : " Installs Node.js via mise-en-place version manager." ,
6
+ "dependsOn" : {
7
+ "ghcr.io/RouL/devcontainer-features/mise:latest" : {}
8
+ },
9
+ "options" : {
10
+ "version" : {
11
+ "description" : " Version to be installed as default." ,
12
+ "type" : " string" ,
13
+ "default" : " lts"
14
+ },
15
+ "extra_versions" : {
16
+ "description" : " Additional versions to be installed. (space separated)" ,
17
+ "type" : " string" ,
18
+ "default" : " "
19
+ }
20
+ }
21
+ }
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/bash
2
+ set -e
3
+
4
+ USERNAME=" ${USERNAME:- " ${_REMOTE_USER:- " automatic" } " } "
5
+ VERSION=" ${VERSION:- lts} "
6
+
7
+ REQUIRED_PACKAGES=" build-essential git ca-certificates"
8
+
9
+ apt_get_update ()
10
+ {
11
+ if [ " $( find /var/lib/apt/lists/* | wc -l) " = " 0" ]; then
12
+ echo " Running apt-get update..."
13
+ apt-get update -y
14
+ fi
15
+ }
16
+
17
+ check_packages () {
18
+ if ! dpkg -s " $@ " > /dev/null 2>&1 ; then
19
+ apt_get_update
20
+ apt-get -y install --no-install-recommends " $@ "
21
+ fi
22
+ }
23
+
24
+ export DEBIAN_FRONTEND=noninteractive
25
+
26
+ check_packages $REQUIRED_PACKAGES
27
+
28
+ install () {
29
+ su ${USERNAME} -c " mise use --global node@${VERSION} "
30
+ }
31
+
32
+ echo " (*) Installing Node (${VERSION} ) via mise as default..."
33
+
34
+ install
35
+
36
+ for extraVersion in $EXTRA_VERSIONS
37
+ do
38
+ echo " (*) Installung Node (${extraVersion} ) via mise"
39
+ su ${USERNAME} -c " mise install node@${VERSION} "
40
+ done
41
+
42
+ # Clean up
43
+ rm -rf /var/lib/apt/lists/*
44
+
45
+ echo " Done!"
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e
3
+
4
+ source dev-container-features-test-lib
5
+
6
+ check " check default node == 20.*" bash -c " node --version | grep -E '^v20\\ .'"
7
+
8
+ reportResults
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e
3
+
4
+ source dev-container-features-test-lib
5
+
6
+ check " check default node == 23.*" bash -c " node --version | grep -E '^v23\\ .'"
7
+ check " check node@22" bash -c " mise exec node@22 -- node --version | grep -E '^v22\\ .'"
8
+ check " check node@20" bash -c " mise exec node@20 -- node --version | grep -E '^v20\\ .'"
9
+
10
+ reportResults
Original file line number Diff line number Diff line change
1
+ {
2
+ "node20" : {
3
+ "image" : " mcr.microsoft.com/devcontainers/base:ubuntu" ,
4
+ "features" : {
5
+ "mise-node" : {
6
+ "version" : " 20"
7
+ }
8
+ }
9
+ },
10
+ "node23_node22_node20" : {
11
+ "image" : " mcr.microsoft.com/devcontainers/base:ubuntu" ,
12
+ "features" : {
13
+ "mise-node" : {
14
+ "version" : " 23" ,
15
+ "extra_versions" : " 22 20"
16
+ }
17
+ }
18
+ }
19
+ }
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e
3
+
4
+ source dev-container-features-test-lib
5
+
6
+ check " check default node" bash -c " node --version | grep -E '^v[1-9][0-9]*\\ .'"
7
+
8
+ reportResults
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
set -e
3
3
4
- sudo apt-get update -y > /dev/null
5
- sudo apt-get install -y curl jq ca-certificates > /dev/null
6
-
7
- CURRENT_VERSION=" $( curl -L --no-progress-meter https://api.github.com/repos/jdx/mise/releases/latest | jq --raw-output ' .tag_name' ) "
8
- CURRENT_VERSION=" ${CURRENT_VERSION# v} "
9
-
10
4
source dev-container-features-test-lib
11
5
12
6
check " check default python" bash -c " python --version | grep -E '^Python '"
You can’t perform that action at this time.
0 commit comments