taler-deployment

Deployment scripts and configuration files
Log | Files | Refs | README

commit 740aeef3ca2c4ebadcadcebb95787b450b6d82b1
parent 559f6cdc0ff39d696ab32ad0be73b73574b1fe0c
Author: Devan Carpenter <devan@taler.net>
Date:   Tue,  6 Jun 2023 13:21:49 -0400

buildbot: add a container factory and builder

the purpose of this new factory and builder is to execute containers
from a given project repository.

Diffstat:
Mbuildbot/master.cfg | 54++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+), 0 deletions(-)

diff --git a/buildbot/master.cfg b/buildbot/master.cfg @@ -159,6 +159,16 @@ def update_deployment(factory): workdir="../.." )) +# Convenience function that builds and runs a container. +def container_job_run(jobCmd="/workdir/ci/ci.sh",): + factory.addStep(steps.ShellSequence( + name="container build and run" + commands=[ + util.ShellArg(command=["podman", "build", "-t", containerName, "."]), + util.ShellArg(command=["podman", "run", "-ti", "--rm", "--volume", "$PWD:/workdir", "--workdir", "/workdir", containerName, jobCmd]), + ], + haltOnFailure=True + )) ################################################################## ######################## JOBS #################################### @@ -1160,6 +1170,50 @@ BUILDERS.append(util.BuilderConfig( EMAIL_ALERTS.append("packaging-debian-builder") EMAIL_ALERTS.append("packaging-ubuntu-builder") +################ 19: CONTAINER FACTORY ################################### +## +# These factories uses the standard podman worker. +WORKERS.append(worker.Worker("container-worker", "container-pass")) + + +#container_repos = ["backoffice", "wallet-core", "bank", "exchange", +# "merchant", "deployment", "twister", "sync", +# "help", "taler-merchant-demos", "challenger"] +# +container_repos = ["wallet-core"] + +for reponame in container_repos: + ## + # Factory-wide variables + GIT_REPO="https://git.taler.net/" + reponame[0] + ".git" + + container_factory = util.BuildFactory() + ## + # Pull repo for given project + container_factory.addStep(git_step(GIT_REPO,"dvn/container-ci")) + container_factory.addStep(container_run_step) + + BUILDERS.append(util.BuilderConfig( + name=reponame + "-builder", + workernames=["container-worker"], + factory=container_factory + )) + # Buildmaster is notified whenever deployment.git changes + SCHEDULERS.append(schedulers.SingleBranchScheduler( + name="container-scheduler", + change_filter=util.ChangeFilter( + branch="dvn/container-ci", + project_re="(" + reponame + ")" + ), + treeStableTimer=None, + builderNames=[reponame + "-builder"] + )) + +## TODO: TBD +#EMAIL_ALERTS.append("container-builder") + + + ################ 99: debug stuff JOB ################################### # This does nothing, just a starting point for a factory.