File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 12
12
13
13
jobs :
14
14
ubuntu :
15
- name : Test installer on ubuntu
15
+ name : Test installer on Ubuntu
16
16
runs-on : ubuntu-latest
17
17
steps :
18
18
- name : Checkout repo
24
24
- name : Test code-server
25
25
run : yarn test:standalone-release code-server
26
26
27
+ alpine :
28
+ name : Test installer on Alpine
29
+ runs-on : ubuntu-latest
30
+ container : " alpine:3.14"
31
+ steps :
32
+ - name : Checkout repo
33
+ uses : actions/checkout@v2
34
+
35
+ - name : Install curl
36
+ run : apk add curl
37
+
38
+ - name : Add user
39
+ run : adduser coder --disabled-password
40
+
41
+ # Standalone should work without root.
42
+ - name : Test standalone to a non-existent prefix
43
+ run : su coder -c "./install.sh --method standalone --prefix /tmp/does/not/yet/exist"
44
+
27
45
macos :
28
46
name : Test installer on macOS
29
47
runs-on : macos-latest
Original file line number Diff line number Diff line change @@ -132,7 +132,6 @@ main() {
132
132
unset \
133
133
DRY_RUN \
134
134
METHOD \
135
- STANDALONE_INSTALL_PREFIX \
136
135
OPTIONAL \
137
136
ALL_FLAGS \
138
137
RSH_ARGS \
@@ -381,6 +380,10 @@ install_standalone() {
381
380
fetch " https://github.com/cdr/code-server/releases/download/v$VERSION /code-server-$VERSION -$OS -$ARCH .tar.gz" \
382
381
" $CACHE_DIR /code-server-$VERSION -$OS -$ARCH .tar.gz"
383
382
383
+ # -w only works if the directory exists so try creating it first. If this
384
+ # fails we can ignore the error as the -w check will then swap us to sudo.
385
+ sh_c mkdir -p " $STANDALONE_INSTALL_PREFIX " 2> /dev/null || true
386
+
384
387
sh_c=" sh_c"
385
388
if [ ! -w " $STANDALONE_INSTALL_PREFIX " ]; then
386
389
sh_c=" sudo_sh_c"
You can’t perform that action at this time.
0 commit comments