[buildbot] buildmaster: provide OpenWrt version in About section

LEDE Commits lede-commits at lists.infradead.org
Thu Mar 25 11:42:59 GMT 2021


ynezz pushed a commit to buildbot.git, branch master:
https://git.openwrt.org/64f3414cd0f3bd983fa8fb41428e8e1d9eeb4225

commit 64f3414cd0f3bd983fa8fb41428e8e1d9eeb4225
Author: Petr Štetiar <ynezz at true.cz>
AuthorDate: Thu Mar 25 11:03:30 2021 +0100

    buildmaster: provide OpenWrt version in About section
    
    So it's clear to anyone which version is actually deployed.
    
    Signed-off-by: Petr Štetiar <ynezz at true.cz>
---
 .gitlab-ci.yml                | 1 +
 .gitlab/docker.yml            | 2 +-
 docker/buildmaster/Dockerfile | 6 ++++++
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0b7214c..b8d1974 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,5 +1,6 @@
 variables:
   BUILDBOT_VERSION: 3.0.2
+  OPENWRT_VERSION: $CI_COMMIT_SHORT_SHA
 
 include:
   - local: .gitlab/docker.yml
diff --git a/.gitlab/docker.yml b/.gitlab/docker.yml
index 752cca9..4c4fc8f 100644
--- a/.gitlab/docker.yml
+++ b/.gitlab/docker.yml
@@ -17,7 +17,7 @@
   script:
     - export IMAGE_NAME="$(echo $CI_JOB_NAME | sed 's/build Docker image \(.*\)/\1/')"
     - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
-    - docker build --build-arg BUILDBOT_VERSION=$BUILDBOT_VERSION -t "$IMAGE_NAME" -f "docker/$IMAGE_NAME/Dockerfile" .
+    - docker build --build-arg BUILDBOT_VERSION=$BUILDBOT_VERSION --build-arg OPENWRT_VERSION=$OPENWRT_VERSION -t "$IMAGE_NAME" -f "docker/$IMAGE_NAME/Dockerfile" .
     - docker tag "$IMAGE_NAME" "$CI_REGISTRY_IMAGE/$IMAGE_NAME-$BUILDBOT_VERSION:$CI_COMMIT_REF_SLUG"
     - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME-$BUILDBOT_VERSION:$CI_COMMIT_REF_SLUG"
 
diff --git a/docker/buildmaster/Dockerfile b/docker/buildmaster/Dockerfile
index 6ddc99d..28dc9ed 100644
--- a/docker/buildmaster/Dockerfile
+++ b/docker/buildmaster/Dockerfile
@@ -3,6 +3,7 @@ MAINTAINER  OpenWrt Maintainers
 
 ARG         DEBIAN_FRONTEND=noninteractive
 ARG         BUILDBOT_VERSION=2.10.1
+ARG         OPENWRT_VERSION=unknown
 
 ENV         BUILDMASTER_CONFIG config.ini
 ENV         BUILDMASTER_PHASE  1
@@ -41,6 +42,11 @@ RUN \
 	's/Welcome to buildbot/Welcome to OpenWrt buildbot/' \
 	/usr/local/lib/python*/dist-packages/buildbot_www/static/scripts.js
 
+RUN \
+	sed -i \
+	"s;\"col-sm-12\"><ul><li ng-repeat;\"col-sm-12\"><ul><li>OpenWrt version: <a href=\"https://git.openwrt.org/$OPENWRT_VERSION\">$OPENWRT_VERSION</a></li><li ng-repeat;" \
+	/usr/local/lib/python*/dist-packages/buildbot_www/static/scripts.js
+
 ENV LANG=en_US.utf8
 
 COPY docker/buildmaster/files/entry.sh /entry.sh



More information about the lede-commits mailing list