From 99d06cf2d231c42e69be60282a8197fe02badd6e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Petr=20=C5=A0tetiar?= Date: Fri, 8 Jan 2021 17:47:12 +0100 Subject: [PATCH] docker: update to 2.10.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Removing the mixing with the testing as it seems, that it's not needed anymore. We can easily just use buildbot from pip. Signed-off-by: Petr Å tetiar --- docker/buildmaster/Dockerfile | 28 ++++++++++++++++------------ docker/buildmaster/files/start.sh | 6 +++--- docker/buildslave/Dockerfile | 19 ++++++++++++------- docker/buildslave/files/start.sh | 4 ++-- 4 files changed, 33 insertions(+), 24 deletions(-) diff --git a/docker/buildmaster/Dockerfile b/docker/buildmaster/Dockerfile index a5add66..fb7a758 100644 --- a/docker/buildmaster/Dockerfile +++ b/docker/buildmaster/Dockerfile @@ -2,16 +2,16 @@ FROM debian:10 MAINTAINER OpenWrt Maintainers ARG DEBIAN_FRONTEND=noninteractive +ARG BUILDBOT_VERSION=2.10.1 ENV BUILDMASTER_CONFIG config.ini ENV BUILDMASTER_PHASE 1 USER root -RUN echo 'deb http://deb.debian.org/debian testing main' \ - > /etc/apt/sources.list.d/testing.list && \ +RUN \ apt-get update && \ - apt-get install -t buster -y \ + apt-get install -y \ pwgen \ locales \ build-essential \ @@ -23,15 +23,15 @@ RUN echo 'deb http://deb.debian.org/debian testing main' \ signify-openbsd \ python3-pip \ wget && \ - apt-get install -t testing -y \ - buildbot && \ apt-get clean && \ - localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 && \ + localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 + +RUN \ pip3 install \ - "buildbot-www==2.4.1" \ - "buildbot-waterfall-view==2.4.1" \ - "buildbot-console-view==2.4.1" \ - "buildbot-grid-view==2.4.1" + "buildbot-www==$BUILDBOT_VERSION" \ + "buildbot-waterfall-view==$BUILDBOT_VERSION" \ + "buildbot-console-view==$BUILDBOT_VERSION" \ + "buildbot-grid-view==$BUILDBOT_VERSION" ENV LANG=en_US.utf8 @@ -41,9 +41,13 @@ COPY phase1 /phase1 COPY phase2 /phase2 COPY scripts /scripts -RUN mkdir /master && \ +RUN \ + groupadd buildbot && \ + useradd \ + --create-home --home-dir /master \ + --comment "OpenWrt buildbot" \ + --gid buildbot --shell /bin/bash buildbot && \ chown buildbot:buildbot /master && \ - usermod --home /master buildbot && \ chmod 0755 /entry.sh /start.sh VOLUME [ "/master" ] diff --git a/docker/buildmaster/files/start.sh b/docker/buildmaster/files/start.sh index 7dc1192..1058e51 100644 --- a/docker/buildmaster/files/start.sh +++ b/docker/buildmaster/files/start.sh @@ -2,7 +2,7 @@ case "${1:-start}" in reconfig) - exec /usr/bin/buildbot reconfig /master + exec /usr/local/bin/buildbot reconfig /master ;; start) case "${BUILDMASTER_PHASE:-1}" in @@ -15,12 +15,12 @@ case "${1:-start}" in ;; esac - /usr/bin/buildbot create-master --config=/phase${BUILDMASTER_PHASE:-1}/master.cfg /master + /usr/local/bin/buildbot create-master --config=/phase${BUILDMASTER_PHASE:-1}/master.cfg /master unset BUILDMASTER_PHASE rm -f /master/twistd.pid - exec /usr/bin/buildbot start --nodaemon /master + exec /usr/local/bin/buildbot start --nodaemon /master ;; /*) exec "$@" diff --git a/docker/buildslave/Dockerfile b/docker/buildslave/Dockerfile index 9ee3ae4..0c60006 100644 --- a/docker/buildslave/Dockerfile +++ b/docker/buildslave/Dockerfile @@ -2,6 +2,7 @@ FROM debian:10 MAINTAINER OpenWrt Maintainers ARG DEBIAN_FRONTEND=noninteractive +ARG BUILDBOT_VERSION=2.10.1 ENV BUILDSLAVE_MASTER builds.openwrt.org:9990 ENV BUILDSLAVE_ADMIN contact@openwrt.org @@ -9,10 +10,9 @@ ENV BUILDSLAVE_DESCRIPTION Buildslave Docker Instance USER root -RUN echo 'deb http://deb.debian.org/debian testing main' \ - > /etc/apt/sources.list.d/testing.list && \ +RUN \ apt-get update && \ - apt-get install -t buster -y \ + apt-get install -y \ pwgen \ locales \ build-essential \ @@ -25,23 +25,28 @@ RUN echo 'deb http://deb.debian.org/debian testing main' \ gosu \ signify-openbsd \ python3 \ + python3-pip \ wget \ curl \ ccache \ rsync && \ - apt-get install -t testing -y \ - buildbot-worker && \ apt-get clean && \ localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 +RUN pip3 install "buildbot-worker==$BUILDBOT_VERSION" + ENV LANG=en_US.utf8 COPY docker/buildslave/files/entry.sh /entry.sh COPY docker/buildslave/files/start.sh /start.sh -RUN mkdir /builder && \ +RUN \ + groupadd buildbot && \ + useradd \ + --create-home --home-dir /builder \ + --comment "OpenWrt buildbot" \ + --gid buildbot --shell /bin/bash buildbot && \ chown buildbot:buildbot /builder && \ - usermod --home /builder buildbot && \ chmod 0755 /entry.sh /start.sh VOLUME [ "/builder" ] diff --git a/docker/buildslave/files/start.sh b/docker/buildslave/files/start.sh index 56f878d..004701c 100644 --- a/docker/buildslave/files/start.sh +++ b/docker/buildslave/files/start.sh @@ -12,7 +12,7 @@ rm -f /builder/buildbot.tac -/usr/bin/buildbot-worker create-worker --force --umask="0o22" /builder \ +/usr/local/bin/buildbot-worker create-worker --force --umask="0o22" /builder \ "$BUILDSLAVE_MASTER" "$BUILDSLAVE_NAME" "$BUILDSLAVE_PASSWORD" if [ "$BUILDSLAVE_TLS" = 1 ]; then @@ -28,4 +28,4 @@ echo "$BUILDSLAVE_DESCRIPTION" > /builder/info/host unset BUILDSLAVE_ADMIN BUILDSLAVE_DESCRIPTION BUILDSLAVE_MASTER BUILDSLAVE_NAME BUILDSLAVE_PASSWORD rm -f /builder/twistd.pid -exec /usr/bin/buildbot-worker start --nodaemon /builder +exec /usr/local/bin/buildbot-worker start --nodaemon /builder -- 2.30.2