This is an automated email from the ASF dual-hosted git repository.

bneradt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/trafficserver-ci.git


The following commit(s) were added to refs/heads/main by this push:
     new 04e7fc1  Adding the jenkins user to some ubuntu images (#248)
04e7fc1 is described below

commit 04e7fc1b8880d23190cf8c31e0a1f71831815cd6
Author: Brian Neradt <[email protected]>
AuthorDate: Wed Oct 18 17:05:23 2023 -0500

    Adding the jenkins user to some ubuntu images (#248)
    
    This will fix some CI test run permissions issues.
---
 docker/ubuntu2204/Dockerfile | 18 ++++++++++++++++++
 docker/ubuntu2304/Dockerfile | 18 ++++++++++++++++++
 2 files changed, 36 insertions(+)

diff --git a/docker/ubuntu2204/Dockerfile b/docker/ubuntu2204/Dockerfile
index eccf131..f891f3b 100644
--- a/docker/ubuntu2204/Dockerfile
+++ b/docker/ubuntu2204/Dockerfile
@@ -20,3 +20,21 @@ RUN <<EOF
 
     apt-get -y autoremove; apt-get -y clean
 EOF
+
+# Add the CI's test user. N.B: 1200 is the uid that our jenkins user is
+# configured with, so that has to be used. Otherwise there will be permissions
+# issues.
+ARG username=jenkins
+ARG uid=1200
+RUN <<EOF
+  set -e
+  useradd \
+    --home-dir /home/${username} \
+    --groups users,sudo \
+    --uid ${uid} \
+    --shell /bin/bash \
+    --create-home \
+    ${username}
+  echo "${username} ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers
+  chown -R ${username} /home/${username}
+EOF
diff --git a/docker/ubuntu2304/Dockerfile b/docker/ubuntu2304/Dockerfile
index 330656d..1561255 100644
--- a/docker/ubuntu2304/Dockerfile
+++ b/docker/ubuntu2304/Dockerfile
@@ -20,3 +20,21 @@ RUN <<EOF
 
     apt-get -y autoremove; apt-get -y clean
 EOF
+
+# Add the CI's test user. N.B: 1200 is the uid that our jenkins user is
+# configured with, so that has to be used. Otherwise there will be permissions
+# issues.
+ARG username=jenkins
+ARG uid=1200
+RUN <<EOF
+  set -e
+  useradd \
+    --home-dir /home/${username} \
+    --groups users,sudo \
+    --uid ${uid} \
+    --shell /bin/bash \
+    --create-home \
+    ${username}
+  echo "${username} ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers
+  chown -R ${username} /home/${username}
+EOF

Reply via email to