[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-deployment] 01/02: buildbot: add support for external repos to co
From: |
gnunet |
Subject: |
[taler-deployment] 01/02: buildbot: add support for external repos to container factory |
Date: |
Thu, 17 Aug 2023 21:26:20 +0200 |
This is an automated email from the git hooks/post-receive script.
devan-carpenter pushed a commit to branch master
in repository deployment.
commit 575051e83c048e6a6a3f2816fc348b9c73e65e7f
Author: Devan Carpenter <devan@taler.net>
AuthorDate: Wed Aug 16 19:47:16 2023 -0400
buildbot: add support for external repos to container factory
---
buildbot/master.cfg | 35 ++++++++++++++++++++---------------
1 file changed, 20 insertions(+), 15 deletions(-)
diff --git a/buildbot/master.cfg b/buildbot/master.cfg
index f29df44..e340239 100644
--- a/buildbot/master.cfg
+++ b/buildbot/master.cfg
@@ -1255,8 +1255,8 @@ def handle_job_config(jobDirPath, jobName, repoName,
configPath, configExist):
class GenerateStagesCommand(buildstep.ShellMixin, steps.BuildStep):
- def __init__(self, reponame, **kwargs):
- self.reponame = reponame
+ def __init__(self, REPO_NAME, **kwargs):
+ self.REPO_NAME = REPO_NAME
kwargs = self.setupShellMixin(kwargs)
super().__init__(**kwargs)
self.observer = logobserver.BufferLogObserver()
@@ -1272,7 +1272,7 @@ class GenerateStagesCommand(buildstep.ShellMixin,
steps.BuildStep):
@defer.inlineCallbacks
def run(self):
- CONTAINER_WORKDIR = f"/home/container-worker/workspace/{self.reponame}"
+ CONTAINER_WORKDIR =
f"/home/container-worker/workspace/{self.REPO_NAME}"
CI_JOBS_PATH = f"{CONTAINER_WORKDIR}/ci/jobs"
# run 'ls <project_root>/ci/jobs/' to get the list of stages
cmd = yield self.makeRemoteShellCommand()
@@ -1300,7 +1300,7 @@ class GenerateStagesCommand(buildstep.ShellMixin,
steps.BuildStep):
print(jobDirPath)
self.configDict.update(
handle_job_config(
- jobDirPath, stage, self.reponame,
+ jobDirPath, stage, self.REPO_NAME,
observer.getStdout(), cmd1.results()))
print(self.configDict)
# create a container step for each stage and
@@ -1325,17 +1325,22 @@ class GenerateStagesCommand(buildstep.ShellMixin,
steps.BuildStep):
return result
-container_repos = ["wallet-core", "merchant", "docs"]
+# List of repos to add to container factory.
+container_repos = ["git.taler.net/wallet-core",
+ "git.taler.net/merchant",
+ "git.taler.net/docs",
+ "git.gnunet.org/gnunet"]
-for reponame in container_repos:
+for repo in container_repos:
# Prepare to read job configs
ini = configparser.ConfigParser()
ini.optionxform = str
# Factory-wide variables
- REPO_URL = "https://git.taler.net/" + reponame + ".git"
- CONTAINER_WORKDIR = f"/home/container-worker/workspace/{reponame}"
+ REPO_NAME = repo.rsplit('/', 1)[1]
+ REPO_URL = "https://" + repo + ".git"
+ CONTAINER_WORKDIR = f"/home/container-worker/workspace/{REPO_NAME}"
CI_JOBS_PATH = f"{CONTAINER_WORKDIR}/ci/jobs"
# Create a factory
@@ -1366,13 +1371,13 @@ for reponame in container_repos:
))
container_factory.addStep(GenerateStagesCommand(
- reponame,
+ REPO_NAME,
name="Generate build stages",
command=["ls", CI_JOBS_PATH],
haltOnFailure=True))
BUILDERS.append(util.BuilderConfig(
- name=f"{reponame}-builder",
+ name=f"{REPO_NAME}-builder",
workernames=["container-worker"],
factory=container_factory
))
@@ -1380,20 +1385,20 @@ for reponame in container_repos:
# Only enable this scheduler for debugging!
# Will run builders with 1 minute of waiting inbetween builds
# SCHEDULERS.append(schedulers.Periodic(
- # name=f"{reponame}-minutely",
- # builderNames=[f"{reponame}-builder"],
+ # name=f"{REPO_NAME}-minutely",
+ # builderNames=[f"{REPO_NAME}-builder"],
# periodicBuildTimer=60
# ))
# Buildmaster is notified whenever deployment.git changes
SCHEDULERS.append(schedulers.SingleBranchScheduler(
- name=f"{reponame}-container-scheduler",
+ name=f"{REPO_NAME}-container-scheduler",
change_filter=util.ChangeFilter(
branch_re='.*',
- project_re=f"({reponame})"
+ project_re=f"({REPO_NAME})"
),
treeStableTimer=None,
- builderNames=[f"{reponame}-builder"]
+ builderNames=[f"{REPO_NAME}-builder"]
))
# TODO: TBD
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.