aboutsummaryrefslogtreecommitdiff
path: root/modules/private/buildbot/projects/immaeEu/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'modules/private/buildbot/projects/immaeEu/__init__.py')
-rw-r--r--modules/private/buildbot/projects/immaeEu/__init__.py66
1 files changed, 63 insertions, 3 deletions
diff --git a/modules/private/buildbot/projects/immaeEu/__init__.py b/modules/private/buildbot/projects/immaeEu/__init__.py
index f29eb14..ad29531 100644
--- a/modules/private/buildbot/projects/immaeEu/__init__.py
+++ b/modules/private/buildbot/projects/immaeEu/__init__.py
@@ -24,6 +24,8 @@ class E():
24 COURS_TARBALL_URL = "https://release.immae.eu/cours" 24 COURS_TARBALL_URL = "https://release.immae.eu/cours"
25 IMMAE_EU_RELEASE_PATH = "/var/lib/buildbot/outputs/immaeEu" 25 IMMAE_EU_RELEASE_PATH = "/var/lib/buildbot/outputs/immaeEu"
26 NORMALESUP_RELEASE_PATH = "/var/lib/buildbot/outputs/recherche" 26 NORMALESUP_RELEASE_PATH = "/var/lib/buildbot/outputs/recherche"
27 GSMCELLS_RELEASE_PATH = "/var/lib/ftp/release.immae.eu/gsm_cells"
28 GSMCELLS_RELEASE_URL = "https://release.immae.eu/gsm_cells"
27 29
28 # master.cfg 30 # master.cfg
29 SECRETS_FILE = os.getcwd() + "/secrets" 31 SECRETS_FILE = os.getcwd() + "/secrets"
@@ -61,19 +63,45 @@ def configure(c):
61 c['schedulers'].append(hook_scheduler("ImmaeEu", timer=1)) 63 c['schedulers'].append(hook_scheduler("ImmaeEu", timer=1))
62 c['schedulers'].append(hook_scheduler("Normalesup", timer=1)) 64 c['schedulers'].append(hook_scheduler("Normalesup", timer=1))
63 c['schedulers'].append(hook_scheduler("Cours", timer=1)) 65 c['schedulers'].append(hook_scheduler("Cours", timer=1))
64 c['schedulers'].append(force_scheduler("force_immae_eu", ["ImmaeEu_build", "Normalesup_build", "Cours_build"])) 66 c['schedulers'].append(schedulers.Nightly(name="GSMCells-weekly",
67 builderNames=["GSMCells_build"], dayOfWeek=6, hour=3))
68 c['schedulers'].append(force_scheduler("force_immae_eu", [
69 "ImmaeEu_build", "Normalesup_build", "Cours_build",
70 ]))
71 c['schedulers'].append(schedulers.ForceScheduler(
72 name="GSMCells-force", label="Force build",
73 buttonName="Force build",
74 reason=util.StringParameter(name="reason", label="Reason", default="Force build"),
75 codebases=[
76 util.CodebaseParameter("",
77 branch=util.FixedParameter(name="branch", default=""),
78 revision=util.FixedParameter(name="revision", default=""),
79 repository=util.FixedParameter(name="repository", default=""),
80 project=util.FixedParameter(name="project", default=""),
81 ),
82 ],
83 username=util.FixedParameter(name="username", default="Web button"),
84 builderNames=["GSMCells_build"]
85 ))
65 86
66 c['builders'].append(immae_eu_factory()) 87 c['builders'].append(immae_eu_factory())
67 c['builders'].append(normalesup_factory()) 88 c['builders'].append(normalesup_factory())
68 c['builders'].append(cours_factory()) 89 c['builders'].append(cours_factory())
90 c['builders'].append(gsm_cells_factory())
69 91
70 c['services'].append(SlackStatusPush( 92 c['services'].append(SlackStatusPush(
71 name="slack_status_immae_eu_project", 93 name="slack_status_immae_eu_project",
72 builders=["ImmaeEu_build", "Normalesup_build", "Cours_build"], 94 builders=[
95 "ImmaeEu_build", "Normalesup_build", "Cours_build",
96 "GSMCells_build"
97 ],
73 serverUrl=open(E.SECRETS_FILE + "/slack_webhook", "r").read().rstrip())) 98 serverUrl=open(E.SECRETS_FILE + "/slack_webhook", "r").read().rstrip()))
74 c['services'].append(XMPPStatusPush( 99 c['services'].append(XMPPStatusPush(
75 name="xmpp_status_immae_eu_project", 100 name="xmpp_status_immae_eu_project",
76 builders=["ImmaeEu_build", "Normalesup_build", "Cours_build"], 101 builders=[
102 "ImmaeEu_build", "Normalesup_build", "Cours_build",
103 "GSMCells_build"
104 ],
77 recipients=E.XMPP_RECIPIENTS, 105 recipients=E.XMPP_RECIPIENTS,
78 password=open(E.SECRETS_FILE + "/notify_xmpp_password", "r").read().rstrip())) 106 password=open(E.SECRETS_FILE + "/notify_xmpp_password", "r").read().rstrip()))
79 107
@@ -158,3 +186,35 @@ def normalesup_factory():
158 factory.addStep(steps.MasterShellCommand(command="chmod -R a+rX {}".format(E.NORMALESUP_RELEASE_PATH))) 186 factory.addStep(steps.MasterShellCommand(command="chmod -R a+rX {}".format(E.NORMALESUP_RELEASE_PATH)))
159 187
160 return util.BuilderConfig(name="Normalesup_build", workernames=["generic-worker-immae-eu"], factory=factory) 188 return util.BuilderConfig(name="Normalesup_build", workernames=["generic-worker-immae-eu"], factory=factory)
189
190def gsm_cells_factory():
191 path_env = {
192 "PATH": os.environ["BUILDBOT_PATH_GSMCells"] + ":${PATH}",
193 "IN_BUILDBOT": "yes",
194 }
195 master_env = {
196 "HTACCESS": '''
197 Options +FollowSymLinks
198 IndexIgnore *
199 '''
200 }
201 for k, v in os.environ.items():
202 if k.startswith("BUILDBOT_GSM_CELLS_"):
203 path_env[k[len("BUILDBOT_GSM_CELLS_"):]] = v
204
205 script = os.environ["BUILDBOT_PROJECT_DIR"] + "/scripts/lacells_download"
206 factory = util.BuildFactory()
207 factory.addStep(steps.ShellCommand(name="download files",
208 logEnviron=False, haltOnFailure=True, command=[script], env=path_env))
209 factory.addStep(steps.ShellCommand(name="give read access to all files",
210 logEnviron=False, haltOnFailure=True,
211 command="chmod a+r lacells.db", env=path_env))
212 factory.addStep(steps.FileUpload(workersrc="lacells.db",
213 masterdest=(E.GSMCELLS_RELEASE_PATH+"/lacells.db"), url=(E.GSMCELLS_RELEASE_URL+"/lacells.db")))
214 factory.addStep(steps.MasterShellCommand(command="touch {}/.duplicity-ignore".format(E.GSMCELLS_RELEASE_PATH)))
215 factory.addStep(steps.MasterShellCommand(command='echo "$HTACCESS" > {}/.htaccess'.format(E.GSMCELLS_RELEASE_PATH),
216 env=master_env))
217 factory.addStep(steps.MasterShellCommand(command="ln -sf lacells.db {}/lacells.db.new".format(E.GSMCELLS_RELEASE_PATH)))
218 factory.addStep(steps.MasterShellCommand(command="chmod -R a+rX {}".format(E.GSMCELLS_RELEASE_PATH)))
219
220 return util.BuilderConfig(name="GSMCells_build", workernames=["generic-worker-immae-eu"], factory=factory)