]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Add documentation website
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Thu, 7 Oct 2021 13:14:03 +0000 (15:14 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Mon, 11 Oct 2021 21:55:30 +0000 (23:55 +0200)
modules/private/buildbot/projects/immaeEu/__init__.py
modules/private/websites/immae/production.nix
nix/sources.json
nixops/secrets

index f119b4f2d2a49f3166a4399b0c1eaff1c755aec8..83265cdfe24c5e6c02f4287b766c61a46a06c4ec 100644 (file)
@@ -20,6 +20,7 @@ class E():
     HISTORY_GIT_URL    = "gitolite@git.immae.eu:perso/Immae/Sites/History"
     RECETTES_GIT_URL   = "gitolite@git.immae.eu:perso/Immae/Sites/Recettes"
     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"
 
     COURS_RELEASE_PATH      = "/var/lib/buildbot/outputs/immae/cours"
@@ -28,6 +29,7 @@ class E():
     BIP39_RELEASE_PATH      = "/var/lib/buildbot/outputs/immae/bip39"
     HISTORY_RELEASE_PATH    = "/var/lib/buildbot/outputs/immae/history"
     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"
     NORMALESUP_RELEASE_PATH = "/var/lib/buildbot/outputs/immae/recherche"
     GSMCELLS_RELEASE_PATH   = "/var/lib/ftp/release.immae.eu/gsm_cells"
@@ -70,12 +72,13 @@ def configure(c):
     c['schedulers'].append(hook_scheduler("Normalesup", timer=1))
     c['schedulers'].append(hook_scheduler("Cours", timer=1))
     c['schedulers'].append(hook_scheduler("Recettes", timer=1))
+    c['schedulers'].append(hook_scheduler("Docs", timer=1))
     c['schedulers'].append(hook_scheduler("History", timer=1))
     c['schedulers'].append(hook_scheduler("BIP39", timer=1))
     c['schedulers'].append(schedulers.Nightly(name="GSMCells-weekly",
         builderNames=["GSMCells_build"], dayOfWeek=6, hour=3))
     c['schedulers'].append(force_scheduler("force_immae_eu", [
-        "ImmaeEu_build", "Normalesup_build", "Cours_build",
+        "ImmaeEu_build", "Normalesup_build", "Cours_build", "Docs_build",
         "Recettes_build", "History_build", "BIP39_build"
         ]))
     c['schedulers'].append(schedulers.ForceScheduler(
@@ -99,13 +102,14 @@ def configure(c):
     c['builders'].append(cours_factory())
     c['builders'].append(gsm_cells_factory())
     c['builders'].append(recettes_factory())
+    c['builders'].append(docs_factory())
     c['builders'].append(history_factory())
     c['builders'].append(bip39_factory())
 
     c['services'].append(SlackStatusPush(
         name="slack_status_immae_eu_project",
         builders=[
-            "ImmaeEu_build", "Normalesup_build", "Cours_build",
+            "ImmaeEu_build", "Normalesup_build", "Cours_build", "Docs_build",
             "GSMCells_build", "Recettes_build", "History_build",
             "BIP39_build"
             ],
@@ -113,7 +117,7 @@ def configure(c):
     c['services'].append(XMPPStatusPush(
         name="xmpp_status_immae_eu_project",
         builders=[
-            "ImmaeEu_build", "Normalesup_build", "Cours_build",
+            "ImmaeEu_build", "Normalesup_build", "Cours_build", "Docs_build",
             "GSMCells_build", "Recettes_build", "History_build",
             "BIP39_build"
             ],
@@ -139,6 +143,25 @@ def history_factory():
 
     return util.BuilderConfig(name="History_build", workernames=["generic-worker-immae-eu"], factory=factory)
 
+def docs_factory():
+    path_env = {
+            "PATH": os.environ["BUILDBOT_PATH_Docs"] + ":${PATH}"
+            }
+    factory = util.BuildFactory()
+    factory.addStep(steps.Git(logEnviron=False, repourl=E.DOCS_GIT_URL,
+        submodules=True, sshPrivateKey=open(E.SSH_KEY_PATH).read().rstrip(),
+        sshHostKey=E.SSH_HOST_KEY, mode="full", method="copy"))
+    factory.addStep(steps.ShellCommand(name="build website",
+        logEnviron=False, haltOnFailure=True, workdir="source",
+        env=path_env, command=["make", "clean", "html"]))
+    factory.addStep(steps.MasterShellCommand(command="rm -rf {}".format(E.DOCS_RELEASE_PATH)))
+    factory.addStep(steps.DirectoryUpload(workersrc="../source/_build/html",
+        masterdest=E.DOCS_RELEASE_PATH,
+        url="https://www.immae.eu/docs"))
+    factory.addStep(steps.MasterShellCommand(command="chmod -R a+rX {}".format(E.DOCS_RELEASE_PATH)))
+
+    return util.BuilderConfig(name="Docs_build", workernames=["generic-worker-immae-eu"], factory=factory)
+
 def recettes_factory():
     path_env = {
             "PATH": os.environ["BUILDBOT_PATH_Recettes"] + ":${PATH}"
index ff9cf9df3910f5558d450f3f95ce0baf84ea0f60..8b4998f39c42df7de04fed3539e33cce495433cb 100644 (file)
@@ -6,6 +6,7 @@ let
   rechercheDir = "/var/lib/buildbot/outputs/immae/recherche";
   recettesDir = "/var/lib/buildbot/outputs/immae/recettes";
   historyDir = "/var/lib/buildbot/outputs/immae/history";
+  docsDir = "/var/lib/buildbot/outputs/immae/docs/";
   env = config.myEnv.websites.immae;
 in {
   options.myServices.websites.immae.production.enable = lib.mkEnableOption "enable Immae's website";
@@ -66,6 +67,14 @@ in {
           Require all granted
         </Directory>
 
+        Alias /docs ${docsDir}
+        <Directory ${docsDir}>
+          DirectoryIndex index.htm index.html
+          Options Indexes FollowSymLinks MultiViews Includes
+          AllowOverride All
+          Require all granted
+        </Directory>
+
         Alias /eurl ${./eurl}
         <Directory ${./eurl}>
           DirectoryIndex index.htm index.html
index bf1edcee7bfdcc061e765dc0e55fcca0266f6906..bc4927807d42920e69d067217855daab12ca7fda 100644 (file)
     "webapps-landing": {
         "ref": "gitolite_local/local_changes",
         "repo": "https://git.immae.eu/github/bastienwirtz/homer.git",
-        "rev": "136303aa36d7d97f27b5944ad7df3a3c14515d91",
+        "rev": "49b6104e9d0059b7990b3dcd53cca664d5cce7af",
         "type": "git",
         "version": "e0a72b7-local"
     },
index d5068b2f6e4a8aa7e6e487b34eef0d90e7f547ca..3b4bfa3cddc7f0621d1bec042a388c32e38245f4 160000 (submodule)
@@ -1 +1 @@
-Subproject commit d5068b2f6e4a8aa7e6e487b34eef0d90e7f547ca
+Subproject commit 3b4bfa3cddc7f0621d1bec042a388c32e38245f4