aboutsummaryrefslogtreecommitdiff
path: root/modules/private/buildbot
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2020-04-25 03:01:39 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2020-04-25 03:01:39 +0200
commit251c0a135a4153453030dc0e2c132e57934c0095 (patch)
treee7ab615568cdfe2526b508e483b2a6c6cad4350e /modules/private/buildbot
parentc54f73c385dcdb7458759b36b62fa0e6895a30d7 (diff)
downloadNix-251c0a135a4153453030dc0e2c132e57934c0095.tar.gz
Nix-251c0a135a4153453030dc0e2c132e57934c0095.tar.zst
Nix-251c0a135a4153453030dc0e2c132e57934c0095.zip
Migrate manual scripts from tools.immae.eu
Landing page BIP39 ldap/myip scripts webhooks
Diffstat (limited to 'modules/private/buildbot')
-rw-r--r--modules/private/buildbot/projects/immaeEu/__init__.py28
1 files changed, 25 insertions, 3 deletions
diff --git a/modules/private/buildbot/projects/immaeEu/__init__.py b/modules/private/buildbot/projects/immaeEu/__init__.py
index ce6cdb1..bb880e5 100644
--- a/modules/private/buildbot/projects/immaeEu/__init__.py
+++ b/modules/private/buildbot/projects/immaeEu/__init__.py
@@ -15,6 +15,7 @@ class E():
15 SSH_HOST_KEY = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIFbhFTl2A2RJn5L51yxJM4XfCS2ZaiSX/jo9jFSdghF" 15 SSH_HOST_KEY = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIFbhFTl2A2RJn5L51yxJM4XfCS2ZaiSX/jo9jFSdghF"
16 XMPP_RECIPIENTS = os.environ["BUILDBOT_XMPP_RECIPIENTS"].split(" ") 16 XMPP_RECIPIENTS = os.environ["BUILDBOT_XMPP_RECIPIENTS"].split(" ")
17 17
18 BIP39_GIT_URL = "https://git.immae.eu/perso/Immae/Projets/Cryptomonnaies/BIP39.git"
18 IMMAE_EU_GIT_URL = "gitolite@git.immae.eu:perso/Immae/Sites/Blog" 19 IMMAE_EU_GIT_URL = "gitolite@git.immae.eu:perso/Immae/Sites/Blog"
19 RECETTES_GIT_URL = "gitolite@git.immae.eu:perso/Immae/Sites/Recettes" 20 RECETTES_GIT_URL = "gitolite@git.immae.eu:perso/Immae/Sites/Recettes"
20 COURS_GIT_URL = "gitolite@git.immae.eu:perso/Immae/Sites/Cours" 21 COURS_GIT_URL = "gitolite@git.immae.eu:perso/Immae/Sites/Cours"
@@ -23,6 +24,7 @@ class E():
23 COURS_RELEASE_PATH = "/var/lib/buildbot/outputs/cours" 24 COURS_RELEASE_PATH = "/var/lib/buildbot/outputs/cours"
24 COURS_TARBALL_PATH = "/var/lib/ftp/release.immae.eu/cours" 25 COURS_TARBALL_PATH = "/var/lib/ftp/release.immae.eu/cours"
25 COURS_TARBALL_URL = "https://release.immae.eu/cours" 26 COURS_TARBALL_URL = "https://release.immae.eu/cours"
27 BIP39_RELEASE_PATH = "/var/lib/buildbot/outputs/bip39"
26 IMMAE_EU_RELEASE_PATH = "/var/lib/buildbot/outputs/immaeEu" 28 IMMAE_EU_RELEASE_PATH = "/var/lib/buildbot/outputs/immaeEu"
27 RECETTES_RELEASE_PATH = "/var/lib/buildbot/outputs/recettes" 29 RECETTES_RELEASE_PATH = "/var/lib/buildbot/outputs/recettes"
28 NORMALESUP_RELEASE_PATH = "/var/lib/buildbot/outputs/recherche" 30 NORMALESUP_RELEASE_PATH = "/var/lib/buildbot/outputs/recherche"
@@ -66,10 +68,12 @@ def configure(c):
66 c['schedulers'].append(hook_scheduler("Normalesup", timer=1)) 68 c['schedulers'].append(hook_scheduler("Normalesup", timer=1))
67 c['schedulers'].append(hook_scheduler("Cours", timer=1)) 69 c['schedulers'].append(hook_scheduler("Cours", timer=1))
68 c['schedulers'].append(hook_scheduler("Recettes", timer=1)) 70 c['schedulers'].append(hook_scheduler("Recettes", timer=1))
71 c['schedulers'].append(hook_scheduler("BIP39", timer=1))
69 c['schedulers'].append(schedulers.Nightly(name="GSMCells-weekly", 72 c['schedulers'].append(schedulers.Nightly(name="GSMCells-weekly",
70 builderNames=["GSMCells_build"], dayOfWeek=6, hour=3)) 73 builderNames=["GSMCells_build"], dayOfWeek=6, hour=3))
71 c['schedulers'].append(force_scheduler("force_immae_eu", [ 74 c['schedulers'].append(force_scheduler("force_immae_eu", [
72 "ImmaeEu_build", "Normalesup_build", "Cours_build", "Recettes_build" 75 "ImmaeEu_build", "Normalesup_build", "Cours_build",
76 "Recettes_build", "BIP39_build"
73 ])) 77 ]))
74 c['schedulers'].append(schedulers.ForceScheduler( 78 c['schedulers'].append(schedulers.ForceScheduler(
75 name="GSMCells-force", label="Force build", 79 name="GSMCells-force", label="Force build",
@@ -92,19 +96,20 @@ def configure(c):
92 c['builders'].append(cours_factory()) 96 c['builders'].append(cours_factory())
93 c['builders'].append(gsm_cells_factory()) 97 c['builders'].append(gsm_cells_factory())
94 c['builders'].append(recettes_factory()) 98 c['builders'].append(recettes_factory())
99 c['builders'].append(bip39_factory())
95 100
96 c['services'].append(SlackStatusPush( 101 c['services'].append(SlackStatusPush(
97 name="slack_status_immae_eu_project", 102 name="slack_status_immae_eu_project",
98 builders=[ 103 builders=[
99 "ImmaeEu_build", "Normalesup_build", "Cours_build", 104 "ImmaeEu_build", "Normalesup_build", "Cours_build",
100 "GSMCells_build", "Recettes_build" 105 "GSMCells_build", "Recettes_build", "BIP39_build"
101 ], 106 ],
102 serverUrl=open(E.SECRETS_FILE + "/slack_webhook", "r").read().rstrip())) 107 serverUrl=open(E.SECRETS_FILE + "/slack_webhook", "r").read().rstrip()))
103 c['services'].append(XMPPStatusPush( 108 c['services'].append(XMPPStatusPush(
104 name="xmpp_status_immae_eu_project", 109 name="xmpp_status_immae_eu_project",
105 builders=[ 110 builders=[
106 "ImmaeEu_build", "Normalesup_build", "Cours_build", 111 "ImmaeEu_build", "Normalesup_build", "Cours_build",
107 "GSMCells_build", "Recettes_build" 112 "GSMCells_build", "Recettes_build", "BIP39_build"
108 ], 113 ],
109 recipients=E.XMPP_RECIPIENTS, 114 recipients=E.XMPP_RECIPIENTS,
110 password=open(E.SECRETS_FILE + "/notify_xmpp_password", "r").read().rstrip())) 115 password=open(E.SECRETS_FILE + "/notify_xmpp_password", "r").read().rstrip()))
@@ -128,6 +133,23 @@ def recettes_factory():
128 133
129 return util.BuilderConfig(name="Recettes_build", workernames=["generic-worker-immae-eu"], factory=factory) 134 return util.BuilderConfig(name="Recettes_build", workernames=["generic-worker-immae-eu"], factory=factory)
130 135
136def bip39_factory():
137 path_env = {
138 "PATH": os.environ["BUILDBOT_PATH_BIP39"] + ":${PATH}"
139 }
140 factory = util.BuildFactory()
141 factory.addStep(steps.Git(logEnviron=False, repourl=E.BIP39_GIT_URL,
142 submodules=True, mode="full", method="copy"))
143 factory.addStep(steps.ShellCommand(name="build file",
144 logEnviron=False, haltOnFailure=True, workdir="source",
145 env=path_env, command=["python", "compile.py"]))
146 factory.addStep(steps.FileUpload(name="upload file", workersrc="bip39-standalone.html",
147 workdir="source", masterdest=E.BIP39_RELEASE_PATH + "/index.html",
148 url="https://tools.immae.eu/BIP39", mode=0o644))
149 factory.addStep(steps.MasterShellCommand(command="chmod -R a+rX {}".format(E.BIP39_RELEASE_PATH)))
150
151 return util.BuilderConfig(name="BIP39_build", workernames=["generic-worker-immae-eu"], factory=factory)
152
131def immae_eu_factory(): 153def immae_eu_factory():
132 path_env = { 154 path_env = {
133 "PATH": os.environ["BUILDBOT_PATH_ImmaeEu"] + ":${PATH}" 155 "PATH": os.environ["BUILDBOT_PATH_ImmaeEu"] + ":${PATH}"