1
1
version : 0.2
2
2
3
+ # Run unprivileged for most phases (except those marked "run-as: root").
4
+ run-as : codebuild-user
5
+
3
6
env :
4
7
variables :
5
8
# Implicitly passed by the AWS automation pipeline:
6
9
# VSCODE_TEST_VERSION
7
10
# GITHUB_READONLY_TOKEN
8
- AWS_TOOLKIT_TEST_USER_DIR : ' /tmp/'
9
11
AWS_TOOLKIT_TEST_NO_COLOR : ' 1'
10
12
NO_COVERAGE : ' true'
11
13
# Suppress noisy apt-get/dpkg warnings like "debconf: unable to initialize frontend: Dialog").
12
14
DEBIAN_FRONTEND : ' noninteractive'
13
15
14
16
phases :
15
17
install :
18
+ run-as : root
16
19
runtime-versions :
17
20
nodejs : 16
18
21
dotnet : 6.0
@@ -43,10 +46,9 @@ phases:
43
46
# Prepare env for unprivileged user.
44
47
#
45
48
- |
46
- # - adduser --gecos GECOS --disabled-password codebuild-user
47
- mkdir ~codebuild-user || true
48
- chown -R codebuild-user:codebuild-user ~codebuild-user
49
- chown -R codebuild-user:codebuild-user .
49
+ # adduser --gecos GECOS --disabled-password toolkit-user
50
+ mkdir -p ~codebuild-user
51
+ chown -R codebuild-user:codebuild-user /tmp ~codebuild-user .
50
52
chmod +x ~codebuild-user
51
53
ls -ld ~codebuild-user
52
54
# Add user to "docker" group.
@@ -56,12 +58,11 @@ phases:
56
58
- chmod 666 /var/run/docker.sock
57
59
58
60
pre_build :
59
- run-as : codebuild-user
60
61
env :
61
62
variables :
62
63
HOME : /home/codebuild-user
63
64
commands :
64
- # codebuild ignores the env.variables.HOME declaration above...?
65
+ # CodeBuild ignores the env.variables.HOME declaration above? :(
65
66
- export HOME=/home/codebuild-user
66
67
- bash buildspec/setup-github-token.sh
67
68
# If present, log into CodeArtifact. Provides a nice safety net in case NPM is down.
@@ -89,12 +90,11 @@ phases:
89
90
# - go version
90
91
91
92
build :
92
- run-as : codebuild-user
93
93
env :
94
94
variables :
95
95
HOME : /home/codebuild-user
96
96
commands :
97
- # codebuild ignores the env.variables.HOME declaration above...?
97
+ # CodeBuild ignores the env.variables.HOME declaration above? :(
98
98
- export HOME=/home/codebuild-user
99
99
- npm ci
100
100
- xvfb-run npm run testInteg
0 commit comments