diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2024-04-26 13:37:58 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2024-04-26 13:37:58 +0000 |
commit | 3fdab81af9fe5d4cb8d8cc1997e10cb54ad06b96 (patch) | |
tree | 86ff8ec0d98220809765de603b418ac32d39e43c | |
parent | bf2ad9a9ff8bab5d70e3f89107544ac95c36d500 (diff) |
tcwg-lnt: Add bin/lnt.sh helper to simplify calling lnt via "docker exec"
Change-Id: Ib56e1c0ec72e5b9d852e479bd503fd10f1d5ba2a
-rw-r--r-- | jammy-amd64-tcwg-base/jammy-amd64-tcwg-lnt/Dockerfile | 6 | ||||
-rw-r--r-- | tcwg-base/tcwg-lnt/Dockerfile.in | 4 | ||||
-rwxr-xr-x | tcwg-base/tcwg-lnt/build.sh | 8 | ||||
-rwxr-xr-x | tcwg-base/tcwg-lnt/lnt.sh | 6 | ||||
-rwxr-xr-x | tcwg-base/tcwg-lnt/run.sh | 2 |
5 files changed, 20 insertions, 6 deletions
diff --git a/jammy-amd64-tcwg-base/jammy-amd64-tcwg-lnt/Dockerfile b/jammy-amd64-tcwg-base/jammy-amd64-tcwg-lnt/Dockerfile index 0100df19..1d4583cc 100644 --- a/jammy-amd64-tcwg-base/jammy-amd64-tcwg-lnt/Dockerfile +++ b/jammy-amd64-tcwg-base/jammy-amd64-tcwg-lnt/Dockerfile @@ -1,10 +1,12 @@ # Auto generated by ./tcwg-base/generate-dockerfiles.sh from tcwg-base/tcwg-lnt/Dockerfile.in. Do not edit. FROM linaro/ci-amd64-tcwg-base-ubuntu:jammy -RUN new-user.sh --user tcwg-buildslave +RUN new-user.sh --user tcwg-buildslave \ + && sudo -i -u tcwg-buildslave mkdir bin +COPY lnt.sh /home/tcwg-buildslave/bin COPY run.sh start.sh / ENV TINI_VERSION v0.18.0 ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-amd64 /sbin/tini RUN chmod +x /sbin/tini ENTRYPOINT ["/sbin/tini", "--", "/run.sh"] CMD ["start.sh"] -# checksum: 6f8fa9cf5aead0b1774e40d332f3541f +# checksum: 502d7b6a7d7304e72a080e9d86554afe diff --git a/tcwg-base/tcwg-lnt/Dockerfile.in b/tcwg-base/tcwg-lnt/Dockerfile.in index 2e124627..d94d408d 100644 --- a/tcwg-base/tcwg-lnt/Dockerfile.in +++ b/tcwg-base/tcwg-lnt/Dockerfile.in @@ -1,6 +1,8 @@ FROM linaro/ci-#{ARCH}-tcwg-base-ubuntu:#{DISTRO} -RUN new-user.sh --user tcwg-buildslave +RUN new-user.sh --user tcwg-buildslave \ + && sudo -i -u tcwg-buildslave mkdir bin +COPY lnt.sh /home/tcwg-buildslave/bin COPY run.sh start.sh / diff --git a/tcwg-base/tcwg-lnt/build.sh b/tcwg-base/tcwg-lnt/build.sh index f4159dc8..518ff4a7 100755 --- a/tcwg-base/tcwg-lnt/build.sh +++ b/tcwg-base/tcwg-lnt/build.sh @@ -10,7 +10,7 @@ trap cleanup_exit INT TERM EXIT cleanup_exit() { - rm -rf run.sh start.sh + rm -rf lnt.sh run.sh start.sh } export LANG=C @@ -20,10 +20,12 @@ name=$(basename ${PWD} | cut -f3- -d '-') image=linaro/ci-${arch}-${name}-ubuntu:${distro} top=$(git rev-parse --show-toplevel) -cp $top/tcwg-base/tcwg-lnt/run.sh \ +cp $top/tcwg-base/tcwg-lnt/lnt.sh \ + $top/tcwg-base/tcwg-lnt/run.sh \ $top/tcwg-base/tcwg-lnt/start.sh ./ -(cd ..; ./build.sh) +#(cd ..; ./build.sh) +docker pull linaro/ci-${arch}-tcwg-base-ubuntu:${distro} "$top"/tcwg-base/validate-checksum.sh Dockerfile docker build --tag=$image . echo $image > .docker-tag diff --git a/tcwg-base/tcwg-lnt/lnt.sh b/tcwg-base/tcwg-lnt/lnt.sh new file mode 100755 index 00000000..e48c9181 --- /dev/null +++ b/tcwg-base/tcwg-lnt/lnt.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +set -euf -o pipefail + +. @LNTSERVER@/sandbox/bin/activate +exec lnt "$@" diff --git a/tcwg-base/tcwg-lnt/run.sh b/tcwg-base/tcwg-lnt/run.sh index 0bcee4ba..d703c62f 100755 --- a/tcwg-base/tcwg-lnt/run.sh +++ b/tcwg-base/tcwg-lnt/run.sh @@ -12,6 +12,8 @@ config="$1" user=tcwg-buildslave scripts=/home/$user/jenkins-scripts +sudo -i -u $user sed -i -e "s#@LNTSERVER@#/home/$user/$config/lntserver#" \ + bin/lnt.sh sudo -i -u $user rm -rf $scripts sudo -i -u $user git clone \ https://git.linaro.org/toolchain/jenkins-scripts.git $scripts |