aboutsummaryrefslogtreecommitdiff
path: root/modules/private/buildbot
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2020-08-08 15:56:45 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2020-08-08 15:56:45 +0200
commit6c95e93c85640e1fe544ed1b6a0b83e27725d0f0 (patch)
treea9a26e16d244311e164222dede579b1228169b20 /modules/private/buildbot
parentf989f3edd7790c9b1a67dc99f074828211bbbe68 (diff)
downloadNix-6c95e93c85640e1fe544ed1b6a0b83e27725d0f0.tar.gz
Nix-6c95e93c85640e1fe544ed1b6a0b83e27725d0f0.tar.zst
Nix-6c95e93c85640e1fe544ed1b6a0b83e27725d0f0.zip
Migrate caldance configuration to nixos
Diffstat (limited to 'modules/private/buildbot')
-rw-r--r--modules/private/buildbot/projects/caldance/__init__.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/modules/private/buildbot/projects/caldance/__init__.py b/modules/private/buildbot/projects/caldance/__init__.py
index 8d4e804..c71eebf 100644
--- a/modules/private/buildbot/projects/caldance/__init__.py
+++ b/modules/private/buildbot/projects/caldance/__init__.py
@@ -22,7 +22,7 @@ class E():
22 XMPP_RECIPIENTS = os.environ["BUILDBOT_XMPP_RECIPIENTS"].split(" ") 22 XMPP_RECIPIENTS = os.environ["BUILDBOT_XMPP_RECIPIENTS"].split(" ")
23 23
24 PUPPET_HOST = { 24 PUPPET_HOST = {
25 "integration": "root@caldance.immae.eu", 25 "integration": [ "-p8022", "root@caldance.immae.eu"],
26 } 26 }
27 27
28 # master.cfg 28 # master.cfg
@@ -132,9 +132,12 @@ def compute_build_infos(project):
132 return compute 132 return compute
133 133
134@util.renderer 134@util.renderer
135def puppet_host(props): 135def puppet_ssh_command(props):
136 environment = props["environment"] if props.hasProperty("environment") else "integration" 136 environment = props["environment"] if props.hasProperty("environment") else "integration"
137 return E.PUPPET_HOST.get(environment, "host.invalid") 137 ssh_command = [
138 "ssh", "-o", "UserKnownHostsFile=/dev/null", "-o", "StrictHostKeyChecking=no", "-o", "CheckHostIP=no",
139 "-i", E.SSH_KEY_PATH ]
140 return ssh_command + E.PUPPET_HOST.get(environment, ["host.invalid"])
138 141
139def deploy_factory(project, locks=[]): 142def deploy_factory(project, locks=[]):
140 package_dest = util.Interpolate("{0}/%(prop:build)s".format(E.RELEASE_PATH)) 143 package_dest = util.Interpolate("{0}/%(prop:build)s".format(E.RELEASE_PATH))
@@ -145,8 +148,7 @@ def deploy_factory(project, locks=[]):
145 factory.addStep(LdapPush(environment=util.Property("environment"), 148 factory.addStep(LdapPush(environment=util.Property("environment"),
146 project=project, build_version=util.Property("build_version"), 149 project=project, build_version=util.Property("build_version"),
147 build_hash=util.Property("build_hash"), ldap_password=util.Secret("ldap"))) 150 build_hash=util.Property("build_hash"), ldap_password=util.Secret("ldap")))
148 factory.addStep(steps.MasterShellCommand(command=[ 151 factory.addStep(steps.MasterShellCommand(command=puppet_ssh_command))
149 "ssh", "-o", "UserKnownHostsFile=/dev/null", "-o", "StrictHostKeyChecking=no", "-o", "CheckHostIP=no", "-i", E.SSH_KEY_PATH, puppet_host]))
150 return util.BuilderConfig( 152 return util.BuilderConfig(
151 name="{}_deploy".format(project.capitalize()), 153 name="{}_deploy".format(project.capitalize()),
152 locks=locks, 154 locks=locks,