aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2020-08-08 15:48:38 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2020-08-08 15:48:38 +0200
commitf989f3edd7790c9b1a67dc99f074828211bbbe68 (patch)
tree34ac46bf4a16b25a07e309dce8fff96d54cfe4cd /modules
parent4c42e0beb65d2a92e988a81aa12f50aa6bd1f820 (diff)
downloadNix-f989f3edd7790c9b1a67dc99f074828211bbbe68.tar.gz
Nix-f989f3edd7790c9b1a67dc99f074828211bbbe68.tar.zst
Nix-f989f3edd7790c9b1a67dc99f074828211bbbe68.zip
Add Denise aventurier website
Diffstat (limited to 'modules')
-rw-r--r--modules/private/buildbot/projects/denise/__init__.py35
-rw-r--r--modules/private/default.nix1
-rw-r--r--modules/private/websites/default.nix1
-rw-r--r--modules/private/websites/denise/aventuriers.nix26
4 files changed, 62 insertions, 1 deletions
diff --git a/modules/private/buildbot/projects/denise/__init__.py b/modules/private/buildbot/projects/denise/__init__.py
index c07655b..bd460d1 100644
--- a/modules/private/buildbot/projects/denise/__init__.py
+++ b/modules/private/buildbot/projects/denise/__init__.py
@@ -17,6 +17,9 @@ class E():
17 OMS_RELEASE_PATH = "/var/lib/buildbot/outputs/denise/oms" 17 OMS_RELEASE_PATH = "/var/lib/buildbot/outputs/denise/oms"
18 OMS_GIT_URL = "gitolite@git.immae.eu:perso/Denise/oms" 18 OMS_GIT_URL = "gitolite@git.immae.eu:perso/Denise/oms"
19 19
20 AVENTURIERS_RELEASE_PATH = "/var/lib/buildbot/outputs/denise/aventuriers"
21 AVENTURIERS_GIT_URL = "https://git.immae.eu/perso/Denise/aventuriers.git"
22
20 # master.cfg 23 # master.cfg
21 SECRETS_FILE = os.getcwd() + "/secrets" 24 SECRETS_FILE = os.getcwd() + "/secrets"
22 LDAP_URL = "ldaps://ldap.immae.eu:636" 25 LDAP_URL = "ldaps://ldap.immae.eu:636"
@@ -51,11 +54,13 @@ def configure(c):
51 c['workers'].append(worker.LocalWorker("generic-worker-denise")) 54 c['workers'].append(worker.LocalWorker("generic-worker-denise"))
52 55
53 c['schedulers'].append(hook_scheduler("DeniseOMS", timer=1)) 56 c['schedulers'].append(hook_scheduler("DeniseOMS", timer=1))
57 c['schedulers'].append(hook_scheduler("DeniseAventuriers", timer=1))
54 c['schedulers'].append(force_scheduler("force_denise", [ 58 c['schedulers'].append(force_scheduler("force_denise", [
55 "DeniseOMS_build" 59 "DeniseOMS_build", "DeniseAventuriers_build"
56 ])) 60 ]))
57 61
58 c['builders'].append(denise_oms_factory()) 62 c['builders'].append(denise_oms_factory())
63 c['builders'].append(denise_aventuriers_factory())
59 64
60def denise_oms_factory(): 65def denise_oms_factory():
61 factory = util.BuildFactory() 66 factory = util.BuildFactory()
@@ -70,3 +75,31 @@ def denise_oms_factory():
70 factory.addStep(steps.MasterShellCommand(command="kill $(cat /run/denise_oms/gunicorn.pid)")) 75 factory.addStep(steps.MasterShellCommand(command="kill $(cat /run/denise_oms/gunicorn.pid)"))
71 76
72 return util.BuilderConfig(name="DeniseOMS_build", workernames=["generic-worker-denise"], factory=factory) 77 return util.BuilderConfig(name="DeniseOMS_build", workernames=["generic-worker-denise"], factory=factory)
78
79def denise_aventuriers_factory():
80 path_env = {
81 "PATH": os.environ["BUILDBOT_PATH_Aventuriers"] + ":${PATH}"
82 }
83
84 factory = util.BuildFactory()
85 factory.addStep(steps.Git(logEnviron=False, repourl=E.AVENTURIERS_GIT_URL,
86 submodules=True, mode="full", method="copy"))
87 factory.addStep(steps.ShellCommand(name="build files",
88 logEnviron=False, haltOnFailure=True, workdir="source",
89 env=path_env, command=["make", "tout", "encyclo"]))
90 factory.addStep(steps.MasterShellCommand(command="rm -rf {}".format(E.AVENTURIERS_RELEASE_PATH)))
91 factory.addStep(steps.DirectoryUpload(workersrc="../source/html",
92 masterdest=E.AVENTURIERS_RELEASE_PATH,
93 url="https://aventuriers.syanni.eu"))
94 factory.addStep(steps.FileUpload(name="upload mobi file", workersrc="aventuriers.mobi",
95 workdir="source", masterdest=E.AVENTURIERS_RELEASE_PATH + "/aventuriers.mobi",
96 url="https://aventuriers.syanni.eu/aventuriers.mobi", mode=0o644))
97 factory.addStep(steps.FileUpload(name="upload pdf file", workersrc="aventuriers.pdf",
98 workdir="source", masterdest=E.AVENTURIERS_RELEASE_PATH + "/aventuriers.pdf",
99 url="https://aventuriers.syanni.eu/aventuriers.pdf", mode=0o644))
100 factory.addStep(steps.FileUpload(name="upload encyclo pdf file", workersrc="encyclo.pdf",
101 workdir="source", masterdest=E.AVENTURIERS_RELEASE_PATH + "/encyclo.pdf",
102 url="https://aventuriers.syanni.eu/encyclo.pdf", mode=0o644))
103 factory.addStep(steps.MasterShellCommand(command="chmod -R a+rX {}".format(E.AVENTURIERS_RELEASE_PATH)))
104
105 return util.BuilderConfig(name="DeniseAventuriers_build", workernames=["generic-worker-denise"], factory=factory)
diff --git a/modules/private/default.nix b/modules/private/default.nix
index 2c8ae6c..9ea136e 100644
--- a/modules/private/default.nix
+++ b/modules/private/default.nix
@@ -32,6 +32,7 @@ set = {
32 deniseDenisejeromeProd = ./websites/denise/denisejerome.nix; 32 deniseDenisejeromeProd = ./websites/denise/denisejerome.nix;
33 deniseEvariste = ./websites/denise/evariste.nix; 33 deniseEvariste = ./websites/denise/evariste.nix;
34 deniseOMS = ./websites/denise/oms.nix; 34 deniseOMS = ./websites/denise/oms.nix;
35 deniseAventuriers = ./websites/denise/aventuriers.nix;
35 deniseProduction = ./websites/denise/production.nix; 36 deniseProduction = ./websites/denise/production.nix;
36 37
37 emiliaMoodle = ./websites/emilia/moodle.nix; 38 emiliaMoodle = ./websites/emilia/moodle.nix;
diff --git a/modules/private/websites/default.nix b/modules/private/websites/default.nix
index 94506c9..d9665ff 100644
--- a/modules/private/websites/default.nix
+++ b/modules/private/websites/default.nix
@@ -241,6 +241,7 @@ in
241 evariste.enable = true; 241 evariste.enable = true;
242 denisejerome.enable = true; 242 denisejerome.enable = true;
243 oms.enable = true; 243 oms.enable = true;
244 aventuriers.enable = true;
244 production.enable = true; 245 production.enable = true;
245 }; 246 };
246 247
diff --git a/modules/private/websites/denise/aventuriers.nix b/modules/private/websites/denise/aventuriers.nix
new file mode 100644
index 0000000..33df53e
--- /dev/null
+++ b/modules/private/websites/denise/aventuriers.nix
@@ -0,0 +1,26 @@
1{ lib, config, pkgs, ... }:
2let
3 cfg = config.myServices.websites.denise.aventuriers;
4 varDir = "/var/lib/buildbot/outputs/denise/aventuriers";
5in {
6 options.myServices.websites.denise.aventuriers.enable = lib.mkEnableOption "enable Denise's Aventuriers website";
7
8 config = lib.mkIf cfg.enable {
9 services.websites.env.production.vhostConfs.denise_aventuriers = {
10 certName = "denise";
11 addToCerts = true;
12 hosts = [ "aventuriers.syanni.eu" ];
13 root = varDir;
14 extraConfig = [
15 ''
16 <Directory ${varDir}>
17 DirectoryIndex index.html
18 Options Indexes FollowSymLinks MultiViews Includes
19 AllowOverride None
20 Require all granted
21 </Directory>
22 ''
23 ];
24 };
25 };
26}