File tree 5 files changed +39
-3
lines changed
5 files changed +39
-3
lines changed Original file line number Diff line number Diff line change
1
+ .PHONY : test
2
+ test :
3
+ devcontainer features test
Original file line number Diff line number Diff line change 23
23
"extensions" : {
24
24
"type" : " string" ,
25
25
"default" : " "
26
- }
26
+ },
27
+ "workspace" : {
28
+ "type" : " string" ,
29
+ "default" : " "
30
+ }
27
31
},
28
32
"entrypoint" : " /usr/local/bin/code-server-entrypoint" ,
29
33
"dependsOn" : {
Original file line number Diff line number Diff line change 3
3
4
4
CODE_SERVER_INSTALL_ARGS=" "
5
5
6
- if [ -n " $VERSION " ]; then
6
+ if [[ -n $VERSION ] ]; then
7
7
CODE_SERVER_INSTALL_ARGS=" $CODE_SERVER_INSTALL_ARGS --version=\" $VERSION \" "
8
8
fi
9
9
17
17
code-server --install-extension " $extension "
18
18
done
19
19
20
+ CODE_SERVER_WORKSPACE=" $_REMOTE_USER_HOME "
21
+
22
+ if [[ -n $WORKSPACE ]]; then
23
+ CODE_SERVER_WORKSPACE=" $WORKSPACE "
24
+ fi
25
+
20
26
cat > /usr/local/bin/code-server-entrypoint \
21
27
<< EOF
22
28
#!/usr/bin/env bash
23
29
set -e
24
30
25
- su $_REMOTE_USER -c 'code-server --bind-addr "$HOST :$PORT " \$ ARGS '
31
+ su $_REMOTE_USER -c 'code-server --bind-addr "$HOST :$PORT " " $CODE_SERVER_WORKSPACE " '
26
32
EOF
27
33
28
34
chmod +x /usr/local/bin/code-server-entrypoint
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e
3
+
4
+ # Optional: Import test library bundled with the devcontainer CLI
5
+ source dev-container-features-test-lib
6
+
7
+ # Feature-specific tests
8
+ check " code-server version" code-server --version
9
+ check " code-server running" pgrep -f ' code-server/lib/node.*/code-server'
10
+ check " code-server listening" lsof -i " @127.0.0.1:8080"
11
+
12
+ check " code-server workspace" grep $' \' code-server.*"/home"\' ' < /usr/local/bin/code-server-entrypoint
13
+
14
+ # Report results
15
+ reportResults
Original file line number Diff line number Diff line change 30
30
"version" : " 4.98.0"
31
31
}
32
32
}
33
+ },
34
+ "code-server-workspace" : {
35
+ "image" : " mcr.microsoft.com/devcontainers/base:ubuntu" ,
36
+ "features" : {
37
+ "code-server" : {
38
+ "workspace" : " /home"
39
+ }
40
+ }
33
41
}
34
42
}
You can’t perform that action at this time.
0 commit comments