diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-03-14 18:27:26 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-03-14 18:27:26 +0100 |
commit | f2a18fd63f6be24fec146080fe3663a3d0e9be55 (patch) | |
tree | 21cc58a4df5c336b0604c499ad0e2dcf6378457f /modules/private | |
parent | e77c7882968645ab066dc3d69b3eba83a3ff3e0b (diff) | |
download | Nix-f2a18fd63f6be24fec146080fe3663a3d0e9be55.tar.gz Nix-f2a18fd63f6be24fec146080fe3663a3d0e9be55.tar.zst Nix-f2a18fd63f6be24fec146080fe3663a3d0e9be55.zip |
Add recettes website
Diffstat (limited to 'modules/private')
-rw-r--r-- | modules/private/buildbot/projects/immaeEu/__init__.py | 29 | ||||
-rw-r--r-- | modules/private/websites/immae/production.nix | 9 |
2 files changed, 35 insertions, 3 deletions
diff --git a/modules/private/buildbot/projects/immaeEu/__init__.py b/modules/private/buildbot/projects/immaeEu/__init__.py index ad29531..cf64ad9 100644 --- a/modules/private/buildbot/projects/immaeEu/__init__.py +++ b/modules/private/buildbot/projects/immaeEu/__init__.py | |||
@@ -16,6 +16,7 @@ class E(): | |||
16 | XMPP_RECIPIENTS = os.environ["BUILDBOT_XMPP_RECIPIENTS"].split(" ") | 16 | XMPP_RECIPIENTS = os.environ["BUILDBOT_XMPP_RECIPIENTS"].split(" ") |
17 | 17 | ||
18 | IMMAE_EU_GIT_URL = "gitolite@git.immae.eu:perso/Immae/Sites/Blog" | 18 | IMMAE_EU_GIT_URL = "gitolite@git.immae.eu:perso/Immae/Sites/Blog" |
19 | RECETTES_GIT_URL = "gitolite@git.immae.eu:perso/Immae/Sites/Recettes" | ||
19 | COURS_GIT_URL = "gitolite@git.immae.eu:perso/Immae/Sites/Cours" | 20 | COURS_GIT_URL = "gitolite@git.immae.eu:perso/Immae/Sites/Cours" |
20 | NORMALESUP_GIT_URL = "gitolite@git.immae.eu:perso/Immae/Projets/Sites/Normalesup" | 21 | NORMALESUP_GIT_URL = "gitolite@git.immae.eu:perso/Immae/Projets/Sites/Normalesup" |
21 | 22 | ||
@@ -23,6 +24,7 @@ class E(): | |||
23 | COURS_TARBALL_PATH = "/var/lib/ftp/release.immae.eu/cours" | 24 | COURS_TARBALL_PATH = "/var/lib/ftp/release.immae.eu/cours" |
24 | COURS_TARBALL_URL = "https://release.immae.eu/cours" | 25 | COURS_TARBALL_URL = "https://release.immae.eu/cours" |
25 | IMMAE_EU_RELEASE_PATH = "/var/lib/buildbot/outputs/immaeEu" | 26 | IMMAE_EU_RELEASE_PATH = "/var/lib/buildbot/outputs/immaeEu" |
27 | RECETTES_RELEASE_PATH = "/var/lib/buildbot/outputs/recettes" | ||
26 | NORMALESUP_RELEASE_PATH = "/var/lib/buildbot/outputs/recherche" | 28 | NORMALESUP_RELEASE_PATH = "/var/lib/buildbot/outputs/recherche" |
27 | GSMCELLS_RELEASE_PATH = "/var/lib/ftp/release.immae.eu/gsm_cells" | 29 | GSMCELLS_RELEASE_PATH = "/var/lib/ftp/release.immae.eu/gsm_cells" |
28 | GSMCELLS_RELEASE_URL = "https://release.immae.eu/gsm_cells" | 30 | GSMCELLS_RELEASE_URL = "https://release.immae.eu/gsm_cells" |
@@ -63,10 +65,11 @@ def configure(c): | |||
63 | c['schedulers'].append(hook_scheduler("ImmaeEu", timer=1)) | 65 | c['schedulers'].append(hook_scheduler("ImmaeEu", timer=1)) |
64 | c['schedulers'].append(hook_scheduler("Normalesup", timer=1)) | 66 | c['schedulers'].append(hook_scheduler("Normalesup", timer=1)) |
65 | c['schedulers'].append(hook_scheduler("Cours", timer=1)) | 67 | c['schedulers'].append(hook_scheduler("Cours", timer=1)) |
68 | c['schedulers'].append(hook_scheduler("Recettes", timer=1)) | ||
66 | c['schedulers'].append(schedulers.Nightly(name="GSMCells-weekly", | 69 | c['schedulers'].append(schedulers.Nightly(name="GSMCells-weekly", |
67 | builderNames=["GSMCells_build"], dayOfWeek=6, hour=3)) | 70 | builderNames=["GSMCells_build"], dayOfWeek=6, hour=3)) |
68 | c['schedulers'].append(force_scheduler("force_immae_eu", [ | 71 | c['schedulers'].append(force_scheduler("force_immae_eu", [ |
69 | "ImmaeEu_build", "Normalesup_build", "Cours_build", | 72 | "ImmaeEu_build", "Normalesup_build", "Cours_build", "Recettes_build" |
70 | ])) | 73 | ])) |
71 | c['schedulers'].append(schedulers.ForceScheduler( | 74 | c['schedulers'].append(schedulers.ForceScheduler( |
72 | name="GSMCells-force", label="Force build", | 75 | name="GSMCells-force", label="Force build", |
@@ -88,23 +91,43 @@ def configure(c): | |||
88 | c['builders'].append(normalesup_factory()) | 91 | c['builders'].append(normalesup_factory()) |
89 | c['builders'].append(cours_factory()) | 92 | c['builders'].append(cours_factory()) |
90 | c['builders'].append(gsm_cells_factory()) | 93 | c['builders'].append(gsm_cells_factory()) |
94 | c['builders'].append(recettes_factory()) | ||
91 | 95 | ||
92 | c['services'].append(SlackStatusPush( | 96 | c['services'].append(SlackStatusPush( |
93 | name="slack_status_immae_eu_project", | 97 | name="slack_status_immae_eu_project", |
94 | builders=[ | 98 | builders=[ |
95 | "ImmaeEu_build", "Normalesup_build", "Cours_build", | 99 | "ImmaeEu_build", "Normalesup_build", "Cours_build", |
96 | "GSMCells_build" | 100 | "GSMCells_build", "Recettes_build" |
97 | ], | 101 | ], |
98 | serverUrl=open(E.SECRETS_FILE + "/slack_webhook", "r").read().rstrip())) | 102 | serverUrl=open(E.SECRETS_FILE + "/slack_webhook", "r").read().rstrip())) |
99 | c['services'].append(XMPPStatusPush( | 103 | c['services'].append(XMPPStatusPush( |
100 | name="xmpp_status_immae_eu_project", | 104 | name="xmpp_status_immae_eu_project", |
101 | builders=[ | 105 | builders=[ |
102 | "ImmaeEu_build", "Normalesup_build", "Cours_build", | 106 | "ImmaeEu_build", "Normalesup_build", "Cours_build", |
103 | "GSMCells_build" | 107 | "GSMCells_build", "Recettes_build" |
104 | ], | 108 | ], |
105 | recipients=E.XMPP_RECIPIENTS, | 109 | recipients=E.XMPP_RECIPIENTS, |
106 | password=open(E.SECRETS_FILE + "/notify_xmpp_password", "r").read().rstrip())) | 110 | password=open(E.SECRETS_FILE + "/notify_xmpp_password", "r").read().rstrip())) |
107 | 111 | ||
112 | def recettes_factory(): | ||
113 | path_env = { | ||
114 | "PATH": os.environ["BUILDBOT_PATH_Recettes"] + ":${PATH}" | ||
115 | } | ||
116 | factory = util.BuildFactory() | ||
117 | factory.addStep(steps.Git(logEnviron=False, repourl=E.RECETTES_GIT_URL, | ||
118 | submodules=True, sshPrivateKey=open(E.SSH_KEY_PATH).read().rstrip(), | ||
119 | sshHostKey=E.SSH_HOST_KEY, mode="full", method="copy")) | ||
120 | factory.addStep(steps.ShellCommand(name="build website", | ||
121 | logEnviron=False, haltOnFailure=True, workdir="source", | ||
122 | env=path_env, command=["jekyll", "build", "--baseurl", "/recettes"])) | ||
123 | factory.addStep(steps.MasterShellCommand(command="rm -rf {}".format(E.RECETTES_RELEASE_PATH))) | ||
124 | factory.addStep(steps.DirectoryUpload(workersrc="../source/_site", | ||
125 | masterdest=E.RECETTES_RELEASE_PATH, | ||
126 | url="https://www.immae.eu/recettes")) | ||
127 | factory.addStep(steps.MasterShellCommand(command="chmod -R a+rX {}".format(E.RECETTES_RELEASE_PATH))) | ||
128 | |||
129 | return util.BuilderConfig(name="Recettes_build", workernames=["generic-worker-immae-eu"], factory=factory) | ||
130 | |||
108 | def immae_eu_factory(): | 131 | def immae_eu_factory(): |
109 | path_env = { | 132 | path_env = { |
110 | "PATH": os.environ["BUILDBOT_PATH_ImmaeEu"] + ":${PATH}" | 133 | "PATH": os.environ["BUILDBOT_PATH_ImmaeEu"] + ":${PATH}" |
diff --git a/modules/private/websites/immae/production.nix b/modules/private/websites/immae/production.nix index 3d76b86..dff1053 100644 --- a/modules/private/websites/immae/production.nix +++ b/modules/private/websites/immae/production.nix | |||
@@ -4,6 +4,7 @@ let | |||
4 | varDir = "/var/lib/buildbot/outputs/immaeEu"; | 4 | varDir = "/var/lib/buildbot/outputs/immaeEu"; |
5 | coursDir = "/var/lib/buildbot/outputs/cours"; | 5 | coursDir = "/var/lib/buildbot/outputs/cours"; |
6 | rechercheDir = "/var/lib/buildbot/outputs/recherche"; | 6 | rechercheDir = "/var/lib/buildbot/outputs/recherche"; |
7 | recettesDir = "/var/lib/buildbot/outputs/recettes"; | ||
7 | env = config.myEnv.websites.immae; | 8 | env = config.myEnv.websites.immae; |
8 | in { | 9 | in { |
9 | options.myServices.websites.immae.production.enable = lib.mkEnableOption "enable Immae's website"; | 10 | options.myServices.websites.immae.production.enable = lib.mkEnableOption "enable Immae's website"; |
@@ -55,6 +56,14 @@ in { | |||
55 | AllowOverride All | 56 | AllowOverride All |
56 | Require all granted | 57 | Require all granted |
57 | </Directory> | 58 | </Directory> |
59 | |||
60 | Alias /recettes ${recettesDir} | ||
61 | <Directory ${recettesDir}> | ||
62 | DirectoryIndex index.htm index.html | ||
63 | Options Indexes FollowSymLinks MultiViews Includes | ||
64 | AllowOverride All | ||
65 | Require all granted | ||
66 | </Directory> | ||
58 | '' | 67 | '' |
59 | ]; | 68 | ]; |
60 | }; | 69 | }; |