]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - flakes/private/buildbot/projects/immaeEu/__init__.py
Add jardin site
[perso/Immae/Config/Nix.git] / flakes / private / buildbot / projects / immaeEu / __init__.py
index f55250ded79ed26534fb236200ed24d9b2d78bed..00c922746a9ed3b52bee0d07e659be24cb10e238 100644 (file)
@@ -21,6 +21,7 @@ class E():
     IMMAE_EU_GIT_URL   = "gitolite@git.immae.eu:perso/Immae/Sites/Blog"
     HISTORY_GIT_URL    = "gitolite@git.immae.eu:perso/Immae/Sites/History"
     RECETTES_GIT_URL   = "gitolite@git.immae.eu:perso/Immae/Sites/Recettes"
+    JARDIN_GIT_URL     = "gitolite@git.immae.eu:perso/Immae/Sites/Jardin"
     COURS_GIT_URL      = "gitolite@git.immae.eu:perso/Immae/Sites/Cours"
     DOCS_GIT_URL       = "gitolite@git.immae.eu:perso/Immae/Sites/Docs"
     NORMALESUP_GIT_URL = "gitolite@git.immae.eu:perso/Immae/Projets/Sites/Normalesup"
@@ -33,6 +34,7 @@ class E():
     IMMAE_EU_RELEASE_PATH   = "/var/lib/buildbot/outputs/immae/blog"
     DOCS_RELEASE_PATH       = "/var/lib/buildbot/outputs/immae/docs"
     RECETTES_RELEASE_PATH   = "/var/lib/buildbot/outputs/immae/recettes"
+    JARDIN_RELEASE_PATH     = "/var/lib/buildbot/outputs/immae/jardin"
     NORMALESUP_RELEASE_PATH = "/var/lib/buildbot/outputs/immae/recherche"
     GSMCELLS_RELEASE_PATH   = "/var/lib/ftp/release.immae.eu/gsm_cells"
     GSMCELLS_RELEASE_URL    = "https://release.immae.eu/gsm_cells"
@@ -63,6 +65,7 @@ def configure(c):
     withbranch.append(_configure("normalesup", normalesup_build_factory, c, worker_name))
     withbranch.append(_configure("cours", cours_build_factory, c, worker_name))
     withbranch.append(_configure("recettes", recettes_build_factory, c, worker_name))
+    withbranch.append(_configure("jardin", jardin_build_factory, c, worker_name))
     withbranch.append(_configure("docs", docs_build_factory, c, worker_name))
     withbranch.append(_configure("history", history_build_factory, c, worker_name))
     withbranch.append(_configure("bip39", bip39_build_factory, c, worker_name))
@@ -274,6 +277,25 @@ def recettes_build_factory():
 
     return factory
 
+def jardin_build_factory():
+    path_env = {
+            "PATH": "/run/current-system/sw/bin"
+            }
+    factory = util.BuildFactory()
+    factory.addStep(steps.Git(logEnviron=False, repourl=E.JARDIN_GIT_URL,
+        submodules=True, sshPrivateKey=open(E.SSH_KEY_PATH).read().rstrip(),
+        sshHostKey=E.SSH_HOST_KEY, mode="full", method="fresh"))
+    factory.addStep(NixShellCommand(name="build website",
+        logEnviron=False, haltOnFailure=True,
+        env=path_env, command="jekyll build --trace --baseurl /jardin"))
+    factory.addStep(steps.MasterShellCommand(command="rm -rf {}".format(E.JARDIN_RELEASE_PATH)))
+    factory.addStep(steps.DirectoryUpload(workersrc="_site",
+        masterdest=E.JARDIN_RELEASE_PATH,
+        url="https://www.immae.eu/jardin"))
+    factory.addStep(steps.MasterShellCommand(command="chmod -R a+rX {}".format(E.JARDIN_RELEASE_PATH)))
+
+    return factory
+
 def bip39_build_factory():
     path_env = {
             "PATH": "/run/current-system/sw/bin",