]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Add jardin site
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 9 Apr 2023 09:39:01 +0000 (11:39 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 9 Apr 2023 15:18:09 +0000 (17:18 +0200)
flakes/private/buildbot/projects/immaeEu/__init__.py
modules/private/websites/immae/production.nix

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",
index 95a8a41a8f174b008b531b986ae0483d78f6320b..3d5f49ec5928ee65fd897e4883adb8a581f74855 100644 (file)
@@ -5,6 +5,7 @@ let
   coursDir = "/var/lib/buildbot/outputs/immae/cours";
   rechercheDir = "/var/lib/buildbot/outputs/immae/recherche";
   recettesDir = "/var/lib/buildbot/outputs/immae/recettes";
+  jardinDir = "/var/lib/buildbot/outputs/immae/jardin";
   historyDir = "/var/lib/buildbot/outputs/immae/history";
   docsDir = "/var/lib/buildbot/outputs/immae/docs/";
   env = config.myEnv.websites.immae;
@@ -94,6 +95,14 @@ in {
           Require all granted
         </Directory>
 
+        Alias /jardin ${jardinDir}
+        <Directory ${jardinDir}>
+          DirectoryIndex index.htm index.html
+          Options Indexes FollowSymLinks MultiViews Includes
+          AllowOverride All
+          Require all granted
+        </Directory>
+
         Alias /history ${historyDir}
         <Directory ${historyDir}>
           DirectoryIndex index.html