]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/buildbot/projects/denise/__init__.py
Make wwwrun run the python application
[perso/Immae/Config/Nix.git] / modules / private / buildbot / projects / denise / __init__.py
index 20ba913002195e38bd9fd9f285b101a82d20066e..2a19ef57c9627a9b53370b24b424a25d7cea32a9 100644 (file)
@@ -71,6 +71,13 @@ def denise_oms_factory():
         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":
@@ -94,7 +101,7 @@ def denise_oms_factory():
         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("kill $(cat %(kw:oms_run_path)s)", oms_run_path=oms_run_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)