File tree Expand file tree Collapse file tree 5 files changed +48
-8
lines changed Expand file tree Collapse file tree 5 files changed +48
-8
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " aqua-installer" ,
3
3
"id" : " aqua-installer" ,
4
- "version" : " 0.1.0 " ,
4
+ "version" : " 0.1.1 " ,
5
5
"description" : " Install aqua" ,
6
6
"options" : {
7
7
"aqua_version" : {
Original file line number Diff line number Diff line change @@ -30,20 +30,21 @@ if ! has_command curl && ! has_command wget; then
30
30
if has_command apt-get; then
31
31
apt-get update -y
32
32
apt-get install -y curl
33
- elif has_command apk > /dev/null 2>&1 ; then
33
+ elif has_command apk; then
34
34
apk add curl
35
35
else
36
36
log_error " Neither curl nor wget is found. Please install either curl or wget to download aqua"
37
37
exit 1
38
38
fi
39
39
fi
40
40
41
- pwd
42
- ls
43
-
44
41
url=https://raw.githubusercontent.com/aquaproj/aqua-installer/v3.0.0/aqua-installer
45
42
46
- tempdir=$( mktemp -d)
43
+ if [ " $_REMOTE_USER " = root ]; then
44
+ tempdir=$( mktemp -d)
45
+ else
46
+ tempdir=$( sudo -u " $_REMOTE_USER " mktemp -d)
47
+ fi
47
48
cd " $tempdir "
48
49
49
50
if has_command curl; then
54
55
55
56
echo " 8299de6c19a8ff6b2cc6ac69669cf9e12a96cece385658310aea4f4646a5496d aqua-installer" | sha256sum -c
56
57
57
- chmod +x aqua-installer
58
- ./aqua-installer
58
+ chmod a+x aqua-installer
59
+ if [ " $_REMOTE_USER " = root ]; then
60
+ ./aqua-installer -v " $AQUA_VERSION "
61
+ else
62
+ if ! has_command sudo; then
63
+ if has_command apt-get; then
64
+ apt-get update -y
65
+ apt-get install -y sudo
66
+ elif has_command apk; then
67
+ apk add sudo
68
+ else
69
+ log_error " Please install sudo to run aqua-installer as $_REMOTE_USER "
70
+ exit 1
71
+ fi
72
+ fi
73
+ sudo -u " $_REMOTE_USER " ./aqua-installer -v " $AQUA_VERSION "
74
+ fi
59
75
60
76
rm -R " $tempdir "
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ set -eu
4
+
5
+ aqua -v
Original file line number Diff line number Diff line change
1
+ FROM alpine:3.19.1
2
+ RUN apk add sudo && \
3
+ sed -i "s|# %wheel ALL=(ALL:ALL) NOPASSWD: ALL|%wheel ALL=(ALL:ALL) NOPASSWD: ALL|" /etc/sudoers && \
4
+ adduser -u 1000 -G wheel -D vscode && \
5
+ rm -rf /var/cache/apk/*
6
+ USER vscode
Original file line number Diff line number Diff line change 20
20
"aqua_version" : " v2.27.0"
21
21
}
22
22
}
23
+ },
24
+ "alpine-nonroot" : {
25
+ "build" : {
26
+ "dockerfile" : " Dockerfile"
27
+ },
28
+ "remoteEnv" : {
29
+ "PATH" : " /home/vscode/.local/share/aquaproj-aqua/bin:${containerEnv:PATH}"
30
+ },
31
+ "features" : {
32
+ "aqua-installer" : {
33
+ "aqua_version" : " v2.27.0"
34
+ }
35
+ }
23
36
}
24
37
}
You can’t perform that action at this time.
0 commit comments