X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fbuildbot%2Fprojects%2FimmaeEu%2F__init__.py;h=83265cdfe24c5e6c02f4287b766c61a46a06c4ec;hb=97f5a24bc8839328571b23eb5f910de206ddbe1f;hp=cf64ad91966642ff2bc5324c882ecc2dd9a83ed2;hpb=f2a18fd63f6be24fec146080fe3663a3d0e9be55;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/buildbot/projects/immaeEu/__init__.py b/modules/private/buildbot/projects/immaeEu/__init__.py index cf64ad9..83265cd 100644 --- a/modules/private/buildbot/projects/immaeEu/__init__.py +++ b/modules/private/buildbot/projects/immaeEu/__init__.py @@ -15,17 +15,23 @@ class E(): SSH_HOST_KEY = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIFbhFTl2A2RJn5L51yxJM4XfCS2ZaiSX/jo9jFSdghF" XMPP_RECIPIENTS = os.environ["BUILDBOT_XMPP_RECIPIENTS"].split(" ") + 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" + 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/cours" + COURS_RELEASE_PATH = "/var/lib/buildbot/outputs/immae/cours" COURS_TARBALL_PATH = "/var/lib/ftp/release.immae.eu/cours" COURS_TARBALL_URL = "https://release.immae.eu/cours" - 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" + 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" GSMCELLS_RELEASE_URL = "https://release.immae.eu/gsm_cells" @@ -66,10 +72,14 @@ 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", "Recettes_build" + "ImmaeEu_build", "Normalesup_build", "Cours_build", "Docs_build", + "Recettes_build", "History_build", "BIP39_build" ])) c['schedulers'].append(schedulers.ForceScheduler( name="GSMCells-force", label="Force build", @@ -92,23 +102,66 @@ 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", - "GSMCells_build", "Recettes_build" + "ImmaeEu_build", "Normalesup_build", "Cours_build", "Docs_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" + "ImmaeEu_build", "Normalesup_build", "Cours_build", "Docs_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 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}" @@ -117,9 +170,9 @@ def recettes_factory(): factory.addStep(steps.Git(logEnviron=False, repourl=E.RECETTES_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", + factory.addStep(NixShellCommand(name="build website", logEnviron=False, haltOnFailure=True, workdir="source", - env=path_env, command=["jekyll", "build", "--baseurl", "/recettes"])) + env=path_env, command="jekyll build --trace --baseurl /recettes")) factory.addStep(steps.MasterShellCommand(command="rm -rf {}".format(E.RECETTES_RELEASE_PATH))) factory.addStep(steps.DirectoryUpload(workersrc="../source/_site", masterdest=E.RECETTES_RELEASE_PATH, @@ -128,6 +181,23 @@ def recettes_factory(): return util.BuilderConfig(name="Recettes_build", workernames=["generic-worker-immae-eu"], factory=factory) +def bip39_factory(): + path_env = { + "PATH": os.environ["BUILDBOT_PATH_BIP39"] + ":${PATH}" + } + factory = util.BuildFactory() + factory.addStep(steps.Git(logEnviron=False, repourl=E.BIP39_GIT_URL, + submodules=True, mode="full", method="copy")) + factory.addStep(steps.ShellCommand(name="build file", + logEnviron=False, haltOnFailure=True, workdir="source", + env=path_env, command=["python", "compile.py"])) + factory.addStep(steps.FileUpload(name="upload file", workersrc="bip39-standalone.html", + workdir="source", masterdest=E.BIP39_RELEASE_PATH + "/index.html", + url="https://tools.immae.eu/BIP39", mode=0o644)) + factory.addStep(steps.MasterShellCommand(command="chmod -R a+rX {}".format(E.BIP39_RELEASE_PATH))) + + return util.BuilderConfig(name="BIP39_build", workernames=["generic-worker-immae-eu"], factory=factory) + def immae_eu_factory(): path_env = { "PATH": os.environ["BUILDBOT_PATH_ImmaeEu"] + ":${PATH}" @@ -149,7 +219,8 @@ def immae_eu_factory(): def cours_factory(): path_env = { - "PATH": os.environ["BUILDBOT_PATH_Cours"] + ":${PATH}" + "PATH": os.environ["BUILDBOT_PATH_Cours"] + ":${PATH}", + "CI": "yes" } factory = util.BuildFactory() factory.addStep(steps.Git(logEnviron=False, repourl=E.COURS_GIT_URL,