aboutsummaryrefslogtreecommitdiff
path: root/modules/private/buildbot/projects/denise/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'modules/private/buildbot/projects/denise/__init__.py')
-rw-r--r--modules/private/buildbot/projects/denise/__init__.py50
1 files changed, 49 insertions, 1 deletions
diff --git a/modules/private/buildbot/projects/denise/__init__.py b/modules/private/buildbot/projects/denise/__init__.py
index 2a19ef5..abeba3c 100644
--- a/modules/private/buildbot/projects/denise/__init__.py
+++ b/modules/private/buildbot/projects/denise/__init__.py
@@ -14,6 +14,10 @@ class E():
14 SSH_KEY_PATH = "/var/lib/buildbot/buildbot_key" 14 SSH_KEY_PATH = "/var/lib/buildbot/buildbot_key"
15 SSH_HOST_KEY = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIFbhFTl2A2RJn5L51yxJM4XfCS2ZaiSX/jo9jFSdghF" 15 SSH_HOST_KEY = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIFbhFTl2A2RJn5L51yxJM4XfCS2ZaiSX/jo9jFSdghF"
16 16
17 BINGO_RELEASE_PATH = "/var/lib/buildbot/outputs/denise/bingo"
18 BINGO_BETA_PATH = "/var/lib/buildbot/outputs/denise/bingo_beta"
19 BINGO_GIT_URL = "gitolite@git.immae.eu:perso/Denise/bingo"
20
17 OMS_RELEASE_PATH = "/var/lib/buildbot/outputs/denise/oms" 21 OMS_RELEASE_PATH = "/var/lib/buildbot/outputs/denise/oms"
18 OMS_BETA_PATH = "/var/lib/buildbot/outputs/denise/oms_beta" 22 OMS_BETA_PATH = "/var/lib/buildbot/outputs/denise/oms_beta"
19 OMS_GIT_URL = "gitolite@git.immae.eu:perso/Denise/oms" 23 OMS_GIT_URL = "gitolite@git.immae.eu:perso/Denise/oms"
@@ -54,15 +58,59 @@ def configure(c):
54 } 58 }
55 c['workers'].append(worker.LocalWorker("generic-worker-denise")) 59 c['workers'].append(worker.LocalWorker("generic-worker-denise"))
56 60
61 c['schedulers'].append(hook_scheduler("DeniseBingo", timer=1))
57 c['schedulers'].append(hook_scheduler("DeniseOMS", timer=1)) 62 c['schedulers'].append(hook_scheduler("DeniseOMS", timer=1))
58 c['schedulers'].append(hook_scheduler("DeniseAventuriers", timer=1)) 63 c['schedulers'].append(hook_scheduler("DeniseAventuriers", timer=1))
59 c['schedulers'].append(force_scheduler("force_denise", [ 64 c['schedulers'].append(force_scheduler("force_denise", [
60 "DeniseOMS_build", "DeniseAventuriers_build" 65 "DeniseBingo_build", "DeniseOMS_build", "DeniseAventuriers_build"
61 ])) 66 ]))
62 67
63 c['builders'].append(denise_oms_factory()) 68 c['builders'].append(denise_oms_factory())
69 c['builders'].append(denise_bingo_factory())
64 c['builders'].append(denise_aventuriers_factory()) 70 c['builders'].append(denise_aventuriers_factory())
65 71
72def denise_bingo_factory():
73 @util.renderer
74 def bingo_run_path(props):
75 if props.hasProperty("branch") and len(props["branch"]) > 0 and props["branch"] == "master":
76 return "/run/denise_bingo/gunicorn.pid"
77 else:
78 return "/run/denise_bingo_beta/gunicorn.pid"
79
80 @util.renderer
81 def bingo_systemd_service(props):
82 if props.hasProperty("branch") and len(props["branch"]) > 0 and props["branch"] == "master":
83 return "denise-bingo"
84 else:
85 return "denise-bingo-beta"
86
87 @util.renderer
88 def bingo_url(props):
89 if props.hasProperty("branch") and len(props["branch"]) > 0 and props["branch"] == "master":
90 return "https://bingo.syanni.eu"
91 else:
92 return "https://beta.bingo.syanni.eu"
93
94 @util.renderer
95 def bingo_path(props):
96 if props.hasProperty("branch") and len(props["branch"]) > 0 and props["branch"] == "master":
97 return E.BINGO_RELEASE_PATH
98 else:
99 return E.BINGO_BETA_PATH
100
101 factory = util.BuildFactory()
102 factory.addStep(steps.Git(logEnviron=False, repourl=E.BINGO_GIT_URL,
103 submodules=True, sshPrivateKey=open(E.SSH_KEY_PATH).read().rstrip(),
104 sshHostKey=E.SSH_HOST_KEY, mode="full", method="copy"))
105 factory.addStep(steps.MasterShellCommand(command=util.Interpolate("rm -rf %(kw:bingo_path)s", bingo_path=bingo_path)))
106 factory.addStep(steps.DirectoryUpload(workersrc="../source",
107 masterdest=bingo_path,
108 url=bingo_url))
109 factory.addStep(steps.MasterShellCommand(command=util.Interpolate("chmod -R a+rX %(kw:bingo_path)s", bingo_path=bingo_path)))
110 factory.addStep(steps.MasterShellCommand(command=util.Interpolate("/run/wrappers/bin/sudo systemctl restart %(kw:bingo_service)s.service", bingo_service=bingo_systemd_service)))
111
112 return util.BuilderConfig(name="DeniseBingo_build", workernames=["generic-worker-denise"], factory=factory)
113
66def denise_oms_factory(): 114def denise_oms_factory():
67 @util.renderer 115 @util.renderer
68 def oms_run_path(props): 116 def oms_run_path(props):