]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/buildbot/projects/immaeEu/__init__.py
Migrate manual scripts from tools.immae.eu
[perso/Immae/Config/Nix.git] / modules / private / buildbot / projects / immaeEu / __init__.py
index ce6cdb1e0b5573d900ccdd9f3d50b41116659ada..bb880e5329d5e31cdf5f12630ab32104dbc22aba 100644 (file)
@@ -15,6 +15,7 @@ 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"
     RECETTES_GIT_URL   = "gitolite@git.immae.eu:perso/Immae/Sites/Recettes"
     COURS_GIT_URL      = "gitolite@git.immae.eu:perso/Immae/Sites/Cours"
@@ -23,6 +24,7 @@ class E():
     COURS_RELEASE_PATH      = "/var/lib/buildbot/outputs/cours"
     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"
     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"
@@ -66,10 +68,12 @@ 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("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",
+        "Recettes_build", "BIP39_build"
         ]))
     c['schedulers'].append(schedulers.ForceScheduler(
         name="GSMCells-force", label="Force build",
@@ -92,19 +96,20 @@ def configure(c):
     c['builders'].append(cours_factory())
     c['builders'].append(gsm_cells_factory())
     c['builders'].append(recettes_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"
+            "GSMCells_build", "Recettes_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"
+            "GSMCells_build", "Recettes_build", "BIP39_build"
             ],
         recipients=E.XMPP_RECIPIENTS,
         password=open(E.SECRETS_FILE + "/notify_xmpp_password", "r").read().rstrip()))
@@ -128,6 +133,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}"