]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Add Denise aventurier website
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Sat, 8 Aug 2020 13:48:38 +0000 (15:48 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Sat, 8 Aug 2020 13:48:38 +0000 (15:48 +0200)
modules/private/buildbot/projects/denise/__init__.py
modules/private/default.nix
modules/private/websites/default.nix
modules/private/websites/denise/aventuriers.nix [new file with mode: 0644]
nix/sources.json

index c07655beb147c1589ef62e08ec8c37dcb530bb25..bd460d16d7dec45264ef5b47ec10669908aea4a3 100644 (file)
@@ -17,6 +17,9 @@ class E():
     OMS_RELEASE_PATH  = "/var/lib/buildbot/outputs/denise/oms"
     OMS_GIT_URL       = "gitolite@git.immae.eu:perso/Denise/oms"
 
+    AVENTURIERS_RELEASE_PATH = "/var/lib/buildbot/outputs/denise/aventuriers"
+    AVENTURIERS_GIT_URL      = "https://git.immae.eu/perso/Denise/aventuriers.git"
+
     # master.cfg
     SECRETS_FILE       = os.getcwd() + "/secrets"
     LDAP_URL           = "ldaps://ldap.immae.eu:636"
@@ -51,11 +54,13 @@ def configure(c):
     c['workers'].append(worker.LocalWorker("generic-worker-denise"))
 
     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"
+        "DeniseOMS_build", "DeniseAventuriers_build"
         ]))
 
     c['builders'].append(denise_oms_factory())
+    c['builders'].append(denise_aventuriers_factory())
 
 def denise_oms_factory():
     factory = util.BuildFactory()
@@ -70,3 +75,31 @@ def denise_oms_factory():
     factory.addStep(steps.MasterShellCommand(command="kill $(cat /run/denise_oms/gunicorn.pid)"))
 
     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}"
+            }
+
+    factory = util.BuildFactory()
+    factory.addStep(steps.Git(logEnviron=False, repourl=E.AVENTURIERS_GIT_URL,
+        submodules=True, mode="full", method="copy"))
+    factory.addStep(steps.ShellCommand(name="build files",
+        logEnviron=False, haltOnFailure=True, workdir="source",
+        env=path_env, command=["make", "tout", "encyclo"]))
+    factory.addStep(steps.MasterShellCommand(command="rm -rf {}".format(E.AVENTURIERS_RELEASE_PATH)))
+    factory.addStep(steps.DirectoryUpload(workersrc="../source/html",
+        masterdest=E.AVENTURIERS_RELEASE_PATH,
+        url="https://aventuriers.syanni.eu"))
+    factory.addStep(steps.FileUpload(name="upload mobi file", workersrc="aventuriers.mobi",
+        workdir="source", masterdest=E.AVENTURIERS_RELEASE_PATH + "/aventuriers.mobi",
+        url="https://aventuriers.syanni.eu/aventuriers.mobi", mode=0o644))
+    factory.addStep(steps.FileUpload(name="upload pdf file", workersrc="aventuriers.pdf",
+        workdir="source", masterdest=E.AVENTURIERS_RELEASE_PATH + "/aventuriers.pdf",
+        url="https://aventuriers.syanni.eu/aventuriers.pdf", mode=0o644))
+    factory.addStep(steps.FileUpload(name="upload encyclo pdf file", workersrc="encyclo.pdf",
+        workdir="source", masterdest=E.AVENTURIERS_RELEASE_PATH + "/encyclo.pdf",
+        url="https://aventuriers.syanni.eu/encyclo.pdf", mode=0o644))
+    factory.addStep(steps.MasterShellCommand(command="chmod -R a+rX {}".format(E.AVENTURIERS_RELEASE_PATH)))
+
+    return util.BuilderConfig(name="DeniseAventuriers_build", workernames=["generic-worker-denise"], factory=factory)
index 2c8ae6c96b621d1889664e0bd8668546a4ad30cf..9ea136e5cc0825fcfd374212936a1914de71f129 100644 (file)
@@ -32,6 +32,7 @@ set = {
   deniseDenisejeromeProd = ./websites/denise/denisejerome.nix;
   deniseEvariste = ./websites/denise/evariste.nix;
   deniseOMS = ./websites/denise/oms.nix;
+  deniseAventuriers = ./websites/denise/aventuriers.nix;
   deniseProduction = ./websites/denise/production.nix;
 
   emiliaMoodle = ./websites/emilia/moodle.nix;
index 94506c9261065e1c18e15b27abadb7a2435f2b35..d9665ff5fe0bb085b7d598c630c2d4f4fcc1d2eb 100644 (file)
@@ -241,6 +241,7 @@ in
         evariste.enable = true;
         denisejerome.enable = true;
         oms.enable = true;
+        aventuriers.enable = true;
         production.enable = true;
       };
 
diff --git a/modules/private/websites/denise/aventuriers.nix b/modules/private/websites/denise/aventuriers.nix
new file mode 100644 (file)
index 0000000..33df53e
--- /dev/null
@@ -0,0 +1,26 @@
+{ lib, config, pkgs, ... }:
+let
+  cfg = config.myServices.websites.denise.aventuriers;
+  varDir = "/var/lib/buildbot/outputs/denise/aventuriers";
+in {
+  options.myServices.websites.denise.aventuriers.enable = lib.mkEnableOption "enable Denise's Aventuriers website";
+
+  config = lib.mkIf cfg.enable {
+    services.websites.env.production.vhostConfs.denise_aventuriers = {
+      certName     = "denise";
+      addToCerts   = true;
+      hosts        = [ "aventuriers.syanni.eu" ];
+      root         = varDir;
+      extraConfig  = [
+        ''
+          <Directory ${varDir}>
+            DirectoryIndex index.html
+            Options Indexes FollowSymLinks MultiViews Includes
+            AllowOverride None
+            Require all granted
+          </Directory>
+          ''
+      ];
+    };
+  };
+}
index 565d3a4b9431f2b41f0a0bdd1dba2b09ff136299..172213944d41810548e1a65110ce9c0476f9536c 100644 (file)
         "url": "https://github.com/NixOS/nixpkgs-channels/archive/fce7562cf46727fdaf801b232116bc9ce0512049.tar.gz",
         "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
     },
+    "buildbot-denise-aventuriers-nixpkgs": {
+        "branch": "nixos-unstable",
+        "description": "Frozen nixpkgs snapshot for texlive",
+        "homepage": "https://github.com/NixOS/nixpkgs",
+        "owner": "NixOS",
+        "repo": "nixpkgs-channels",
+        "rev": "8e2b14aceb1d40c7e8b84c03a7c78955359872bb",
+        "sha256": "0zzjpd9smr7rxzrdf6raw9kbj42fbvafxb5bz36lcxgv290pgsm8",
+        "type": "tarball",
+        "url": "https://github.com/NixOS/nixpkgs-channels/archive/8e2b14aceb1d40c7e8b84c03a7c78955359872bb.tar.gz",
+        "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
+    },
     "buildbot-history-deps": {
         "ref": "master",
         "repo": "ssh://gitolite@git.immae.eu/perso/Immae/Sites/History",