commit 13ff12c811fda692da9e45305528f963b0f71d82
parent 2f2372fd65f5bba7f9ab2dcfbe0916016dc2ccec
Author: Devan Carpenter <devan@taler.net>
Date: Mon, 12 Jun 2023 23:09:50 -0400
buildbot: generate steps from project's CI dir
This should allow any repo added to the "container builder" to generate
steps by adding a subdir to "<project_root>/ci/jobs/" containing shell
scripts. Each script will create a new step in the factory.
Diffstat:
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/buildbot/master.cfg b/buildbot/master.cfg
@@ -24,6 +24,8 @@
# @author ng0
# @author Christian Grothoff
# @author Devan Carpenter
+import os
+import pathlib
import re
from buildbot.steps.source.git import Git
@@ -1198,7 +1200,7 @@ EMAIL_ALERTS.append("packaging-ubuntu-builder")
#############################################
##
# These factories uses the standard podman worker.
-WORKERS.append(worker.Worker("container-worker", "container-pass"))
+WORKERS.append(Worker("container-worker", "container-pass"))
#
# container_repos = ["backoffice", "wallet-core", "bank", "exchange",
@@ -1240,9 +1242,22 @@ for reponame in container_repos:
))
# Run container step with default commands
- container_run_step("Build docs",
- container_factory, CONTAINER_WORKDIR, reponame,
- "ci/jobs/docs.sh")
+ CI_JOBS_PATH = f"{CONTAINER_WORKDIR}/ci/jobs"
+ if os.path.exists(CI_JOBS_PATH):
+ for parentDir, dirNames, fileNames in os.walk(CI_JOBS_PATH):
+ dirNames.sort()
+ fileNames.sort()
+ for filename in fileNames:
+ if filename.endswith('.sh'):
+ basedir = pathlib.PurePath(parentDir)
+ container_run_step(basedir,
+ container_factory,
+ CONTAINER_WORKDIR, reponame,
+ f"ci/jobs/{basedir}/{filename}")
+ else:
+ print("No jobs found")
+ else:
+ print("Cannot find jobs directory")
BUILDERS.append(util.BuilderConfig(
name=f"{reponame}-builder",