File tree 3 files changed +12
-17
lines changed
3 files changed +12
-17
lines changed Original file line number Diff line number Diff line change @@ -30,18 +30,11 @@ ecr-login:
30
30
push-serverless-custom-file :
31
31
aws s3 cp serverless-custom.yml s3://rstudio-devops/r-builds/serverless-custom.yml
32
32
33
- # Temporarily patch serverless-custom.yml to not Dockerize pip and disable
34
- # serverless-python-requirements caching. The caching does not work in Jenkins
35
- # by default because the cache directory is resolved to a relative ".cache"
36
- # directory, rather than an absolute directory, which breaks the plugin.
37
- # The cache directory must either be an absolute path (optionally specified
38
- # via cacheLocation: /path/to/cache), or caching must be disabled for the plugin
39
- # to work. We disable caching completely to avoid all sorts of future issues.
40
- # The cache directory is based on $HOME, which is set to "." when running
41
- # Docker images in Jenkins for some reason.
33
+ # Temporarily patch serverless-custom.yml to not Dockerize pip for the
34
+ # serverless-python-requirements plugin.
42
35
fetch-serverless-custom-file :
43
36
aws s3 cp s3://rstudio-devops/r-builds/serverless-custom.yml .
44
- sed -i ' s|dockerizePip: true|dockerizePip: false\n useStaticCache: false\n useDownloadCache: false |' serverless-custom.yml
37
+ sed -i ' s|dockerizePip: true|dockerizePip: false|' serverless-custom.yml
45
38
46
39
rebuild-all : deps fetch-serverless-custom-file
47
40
$(SLS_BINARY ) invoke stepf -n rBuilds -d ' {"force": true}'
Original file line number Diff line number Diff line change @@ -5,13 +5,6 @@ pipeline {
5
5
label 'docker'
6
6
}
7
7
}
8
- environment {
9
- // Set HOME to the workspace for the serverless-python-requirements plugin.
10
- // The plugin uses HOME for its default cache location, which needs to be
11
- // mounted in the separate Python build container. This needs to be an absolute
12
- // path that also exists on the host since we're mounting the Docker socket.
13
- HOME = "${env.WORKSPACE}"
14
- }
15
8
options {
16
9
ansiColor('xterm')
17
10
}
Original file line number Diff line number Diff line change 5
5
6
6
FROM ubuntu:jammy
7
7
8
+ ARG JENKINS_UID=386
9
+ ARG JENKINS_GID=386
10
+
8
11
# Keep the Python version in line with the runtime in serverless.yml
9
12
ARG PYTHON_VERSION=3.8.15
10
13
@@ -32,3 +35,9 @@ RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - \
32
35
&& apt install -y nodejs
33
36
34
37
RUN npm install -g serverless
38
+
39
+ # Create the jenkins user with the same id:gid as the jenkins node
40
+ RUN groupadd -g $JENKINS_GID jenkins \
41
+ && useradd -m -d /var/lib/jenkins -u $JENKINS_UID -g jenkins jenkins
42
+
43
+ USER jenkins
You can’t perform that action at this time.
0 commit comments