SSH_KEY_PATH = "/var/lib/buildbot/buildbot_key"
SSH_HOST_KEY = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIFbhFTl2A2RJn5L51yxJM4XfCS2ZaiSX/jo9jFSdghF"
+ BINGO_RELEASE_PATH = "/var/lib/buildbot/outputs/denise/bingo"
+ BINGO_BETA_PATH = "/var/lib/buildbot/outputs/denise/bingo_beta"
+ BINGO_GIT_URL = "gitolite@git.immae.eu:perso/Denise/bingo"
+
OMS_RELEASE_PATH = "/var/lib/buildbot/outputs/denise/oms"
+ OMS_BETA_PATH = "/var/lib/buildbot/outputs/denise/oms_beta"
OMS_GIT_URL = "gitolite@git.immae.eu:perso/Denise/oms"
AVENTURIERS_RELEASE_PATH = "/var/lib/buildbot/outputs/denise/aventuriers"
}
c['workers'].append(worker.LocalWorker("generic-worker-denise"))
+ c['schedulers'].append(hook_scheduler("DeniseBingo", timer=1))
c['schedulers'].append(hook_scheduler("DeniseOMS", timer=1))
c['schedulers'].append(hook_scheduler("DeniseAventuriers", timer=1))
c['schedulers'].append(force_scheduler("force_denise", [
- "DeniseOMS_build", "DeniseAventuriers_build"
+ "DeniseBingo_build", "DeniseOMS_build", "DeniseAventuriers_build"
]))
c['builders'].append(denise_oms_factory())
+ c['builders'].append(denise_bingo_factory())
c['builders'].append(denise_aventuriers_factory())
+def denise_bingo_factory():
+ @util.renderer
+ def bingo_run_path(props):
+ if props.hasProperty("branch") and len(props["branch"]) > 0 and props["branch"] == "master":
+ return "/run/denise_bingo/gunicorn.pid"
+ else:
+ return "/run/denise_bingo_beta/gunicorn.pid"
+
+ @util.renderer
+ def bingo_systemd_service(props):
+ if props.hasProperty("branch") and len(props["branch"]) > 0 and props["branch"] == "master":
+ return "denise-bingo"
+ else:
+ return "denise-bingo-beta"
+
+ @util.renderer
+ def bingo_url(props):
+ if props.hasProperty("branch") and len(props["branch"]) > 0 and props["branch"] == "master":
+ return "https://bingo.syanni.eu"
+ else:
+ return "https://beta.bingo.syanni.eu"
+
+ @util.renderer
+ def bingo_path(props):
+ if props.hasProperty("branch") and len(props["branch"]) > 0 and props["branch"] == "master":
+ return E.BINGO_RELEASE_PATH
+ else:
+ return E.BINGO_BETA_PATH
+
+ factory = util.BuildFactory()
+ factory.addStep(steps.Git(logEnviron=False, repourl=E.BINGO_GIT_URL,
+ submodules=True, sshPrivateKey=open(E.SSH_KEY_PATH).read().rstrip(),
+ sshHostKey=E.SSH_HOST_KEY, mode="full", method="copy"))
+ factory.addStep(steps.MasterShellCommand(command=util.Interpolate("rm -rf %(kw:bingo_path)s", bingo_path=bingo_path)))
+ factory.addStep(steps.DirectoryUpload(workersrc="../source",
+ masterdest=bingo_path,
+ url=bingo_url))
+ factory.addStep(steps.MasterShellCommand(command=util.Interpolate("chmod -R a+rX %(kw:bingo_path)s", bingo_path=bingo_path)))
+ factory.addStep(steps.MasterShellCommand(command=util.Interpolate("/run/wrappers/bin/sudo systemctl restart %(kw:bingo_service)s.service", bingo_service=bingo_systemd_service)))
+
+ return util.BuilderConfig(name="DeniseBingo_build", workernames=["generic-worker-denise"], factory=factory)
+
def denise_oms_factory():
+ @util.renderer
+ def oms_run_path(props):
+ if props.hasProperty("branch") and len(props["branch"]) > 0 and props["branch"] == "master":
+ return "/run/denise_oms/gunicorn.pid"
+ else:
+ return "/run/denise_oms_beta/gunicorn.pid"
+
+ @util.renderer
+ def oms_systemd_service(props):
+ if props.hasProperty("branch") and len(props["branch"]) > 0 and props["branch"] == "master":
+ return "denise-oms"
+ else:
+ return "denise-oms-beta"
+
+ @util.renderer
+ def oms_url(props):
+ if props.hasProperty("branch") and len(props["branch"]) > 0 and props["branch"] == "master":
+ return "https://oms.syanni.eu"
+ else:
+ return "https://beta.oms.syanni.eu"
+
+ @util.renderer
+ def oms_path(props):
+ if props.hasProperty("branch") and len(props["branch"]) > 0 and props["branch"] == "master":
+ return E.OMS_RELEASE_PATH
+ else:
+ return E.OMS_BETA_PATH
+
factory = util.BuildFactory()
factory.addStep(steps.Git(logEnviron=False, repourl=E.OMS_GIT_URL,
submodules=True, sshPrivateKey=open(E.SSH_KEY_PATH).read().rstrip(),
sshHostKey=E.SSH_HOST_KEY, mode="full", method="copy"))
- factory.addStep(steps.MasterShellCommand(command="rm -rf {}".format(E.OMS_RELEASE_PATH)))
+ factory.addStep(steps.MasterShellCommand(command=util.Interpolate("rm -rf %(kw:oms_path)s", oms_path=oms_path)))
factory.addStep(steps.DirectoryUpload(workersrc="../source",
- masterdest=E.OMS_RELEASE_PATH,
- url="https://oms.syanni.eu"))
- factory.addStep(steps.MasterShellCommand(command="chmod -R a+rX {}".format(E.OMS_RELEASE_PATH)))
- factory.addStep(steps.MasterShellCommand(command="kill $(cat /run/denise_oms/gunicorn.pid)"))
+ masterdest=oms_path,
+ url=oms_url))
+ factory.addStep(steps.MasterShellCommand(command=util.Interpolate("chmod -R a+rX %(kw:oms_path)s", oms_path=oms_path)))
+ factory.addStep(steps.MasterShellCommand(command=util.Interpolate("/run/wrappers/bin/sudo systemctl restart %(kw:oms_service)s.service", oms_service=oms_systemd_service)))
return util.BuilderConfig(name="DeniseOMS_build", workernames=["generic-worker-denise"], factory=factory)
def denise_aventuriers_factory():
path_env = {
- "PATH": os.environ["BUILDBOT_PATH_Aventuriers"] + ":${PATH}"
+ "PATH": os.environ["BUILDBOT_PATH_Aventuriers"] + ":${PATH}",
+ "TZ": "Europe/Paris",
}
factory = util.BuildFactory()