gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-deployment] 04/05: buildbot: add a container factory and builder


From: gnunet
Subject: [taler-deployment] 04/05: buildbot: add a container factory and builder
Date: Mon, 12 Jun 2023 20:58:18 +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 740aeef3ca2c4ebadcadcebb95787b450b6d82b1
Author: Devan Carpenter <devan@taler.net>
AuthorDate: Tue Jun 6 13:21:49 2023 -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.
---
 buildbot/master.cfg | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/buildbot/master.cfg b/buildbot/master.cfg
index c56e410..2059d0f 100644
--- 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.

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]