From 577d00ee5ea4c8851af2cd5811f0c8829db41178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Mon, 15 Jun 2020 13:00:00 +0200 Subject: Put history generator in separate repository MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thunderbird doesn’t like feed.xml at timestamp 1 --- .../private/buildbot/projects/immaeEu/__init__.py | 31 +++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'modules/private/buildbot/projects/immaeEu') diff --git a/modules/private/buildbot/projects/immaeEu/__init__.py b/modules/private/buildbot/projects/immaeEu/__init__.py index bb880e5..575f083 100644 --- a/modules/private/buildbot/projects/immaeEu/__init__.py +++ b/modules/private/buildbot/projects/immaeEu/__init__.py @@ -17,6 +17,7 @@ class E(): BIP39_GIT_URL = "https://git.immae.eu/perso/Immae/Projets/Cryptomonnaies/BIP39.git" 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" COURS_GIT_URL = "gitolite@git.immae.eu:perso/Immae/Sites/Cours" NORMALESUP_GIT_URL = "gitolite@git.immae.eu:perso/Immae/Projets/Sites/Normalesup" @@ -25,6 +26,7 @@ class E(): COURS_TARBALL_PATH = "/var/lib/ftp/release.immae.eu/cours" COURS_TARBALL_URL = "https://release.immae.eu/cours" BIP39_RELEASE_PATH = "/var/lib/buildbot/outputs/bip39" + HISTORY_RELEASE_PATH = "/var/lib/buildbot/outputs/immae/history" IMMAE_EU_RELEASE_PATH = "/var/lib/buildbot/outputs/immaeEu" RECETTES_RELEASE_PATH = "/var/lib/buildbot/outputs/recettes" NORMALESUP_RELEASE_PATH = "/var/lib/buildbot/outputs/recherche" @@ -68,12 +70,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("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", - "Recettes_build", "BIP39_build" + "Recettes_build", "History_build", "BIP39_build" ])) c['schedulers'].append(schedulers.ForceScheduler( name="GSMCells-force", label="Force build", @@ -96,24 +99,46 @@ def configure(c): c['builders'].append(cours_factory()) c['builders'].append(gsm_cells_factory()) c['builders'].append(recettes_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", - "GSMCells_build", "Recettes_build", "BIP39_build" + "GSMCells_build", "Recettes_build", "History_build", + "BIP39_build" ], serverUrl=open(E.SECRETS_FILE + "/slack_webhook", "r").read().rstrip())) c['services'].append(XMPPStatusPush( name="xmpp_status_immae_eu_project", builders=[ "ImmaeEu_build", "Normalesup_build", "Cours_build", - "GSMCells_build", "Recettes_build", "BIP39_build" + "GSMCells_build", "Recettes_build", "History_build", + "BIP39_build" ], recipients=E.XMPP_RECIPIENTS, password=open(E.SECRETS_FILE + "/notify_xmpp_password", "r").read().rstrip())) +def history_factory(): + path_env = { + "PATH": os.environ["BUILDBOT_PATH_History"] + ":${PATH}" + } + factory = util.BuildFactory() + factory.addStep(steps.Git(logEnviron=False, repourl=E.HISTORY_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=["jekyll", "build"])) + factory.addStep(steps.MasterShellCommand(command="rm -rf {}".format(E.HISTORY_RELEASE_PATH))) + factory.addStep(steps.DirectoryUpload(workersrc="../source/_site", + masterdest=E.HISTORY_RELEASE_PATH, + url="https://www.immae.eu/history")) + factory.addStep(steps.MasterShellCommand(command="chmod -R a+rX {}".format(E.HISTORY_RELEASE_PATH))) + + return util.BuilderConfig(name="History_build", workernames=["generic-worker-immae-eu"], factory=factory) + def recettes_factory(): path_env = { "PATH": os.environ["BUILDBOT_PATH_Recettes"] + ":${PATH}" -- cgit v1.2.3