docker: make TLS working
authorPetr Štetiar <ynezz@true.cz>
Thu, 14 Jan 2021 16:27:49 +0000 (17:27 +0100)
committerPetr Štetiar <ynezz@true.cz>
Tue, 2 Mar 2021 11:47:11 +0000 (12:47 +0100)
Fixes following errors during setup:

 buildslave-phase2_1   | Failed to load application: name 'optionsForClientTLS' is not defined

 [-] while starting BuildMaster
 ...
 builtins.ModuleNotFoundError: No module named 'OpenSSL'

Signed-off-by: Petr Štetiar <ynezz@true.cz>
docker/buildmaster/Dockerfile
docker/buildslave/Dockerfile
docker/buildslave/files/start.sh

index 23b907ba6e902a14080daca2a2974b46d7da1438..cc85aabc90c15c3df250e2ce03076c17319f93ab 100644 (file)
@@ -31,7 +31,9 @@ RUN \
                "buildbot-www==$BUILDBOT_VERSION" \
                "buildbot-waterfall-view==$BUILDBOT_VERSION" \
                "buildbot-console-view==$BUILDBOT_VERSION" \
-               "buildbot-grid-view==$BUILDBOT_VERSION"
+               "buildbot-grid-view==$BUILDBOT_VERSION" \
+               pyOpenSSL \
+               service_identity
 
 ENV LANG=en_US.utf8
 
index c51b5d2997a5b2862790d4229940b1f6ce3d767f..2da6910605b56a2bf798ee10688d2bd511e2bc0f 100644 (file)
@@ -34,7 +34,10 @@ RUN \
        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"
+RUN pip3 install \
+               "buildbot-worker==$BUILDBOT_VERSION" \
+               pyOpenSSL \
+               service_identity
 
 ENV LANG=en_US.utf8
 
index 004701cc0d51e3c7e7c8f89b3ed4eabb505fdb13..20ac53a0c8e908220725943c01c4ee6378671010 100644 (file)
@@ -12,7 +12,9 @@
 
 rm -f /builder/buildbot.tac
 
-/usr/local/bin/buildbot-worker create-worker --force --umask="0o22" /builder \
+use_tls=""
+[ "$BUILDSLAVE_TLS" = 1 ] && use_tls="--use-tls"
+/usr/local/bin/buildbot-worker create-worker --force --umask="0o22" $use_tls /builder \
     "$BUILDSLAVE_MASTER" "$BUILDSLAVE_NAME" "$BUILDSLAVE_PASSWORD"
 
 if [ "$BUILDSLAVE_TLS" = 1 ]; then