<pre style='margin:0'>
Rainer Müller (raimue) pushed a commit to branch master
in repository macports-infrastructure.
</pre>
<p><a href="https://github.com/macports/macports-infrastructure/commit/70a2e8ed748c1260793d7c2afd393352a3ee6d10">https://github.com/macports/macports-infrastructure/commit/70a2e8ed748c1260793d7c2afd393352a3ee6d10</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 70a2e8ed748c1260793d7c2afd393352a3ee6d10
</span>Author: Rainer Müller <raimue@macports.org>
AuthorDate: Wed Nov 16 21:51:09 2016 +0100
<span style='display:block; white-space:pre;color:#404040;'> buildbot: move rsync deployment into own step
</span>---
buildbot/master.cfg | 54 ++++++++++++++++++++++++++++++-----------------------
1 file changed, 31 insertions(+), 23 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/buildbot/master.cfg b/buildbot/master.cfg
</span><span style='display:block; white-space:pre;color:#808080;'>index 7480027..098db2e 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/buildbot/master.cfg
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/buildbot/master.cfg
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -506,7 +506,18 @@ portbuilder_factory.addStep(steps.ShellCommand(
</span> descriptionDone=['clean'],
alwaysRun=True))
<span style='display:block; white-space:pre;background:#ffe0e0;'>-def make_rsync_deploy_steps(host, user, sshkeyfile, sshknownhostsfile, srcpath, destpath):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+class RsyncDeployStep(steps.ShellCommand):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ def __init__(self, host, user, srcpath, destpath, **kwargs):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ super(RsyncDeployStep, self).__init__(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ name='rsync',
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ description='deploying',
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ descriptionDone='deployed',
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ command='rsync -avzhC --delay-updates --delete-delay %s/ %s@%s:%s/' % (srcpath, user, host, destpath),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ env={'RSYNC_RSH': 'ssh -i ssh_key -oUserKnownHostsFile=ssh_known_hosts'})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+def make_ssh_deploy_step(sshkeyfile, sshknownhostsfile, step):
</span> return (
steps.FileDownload(
name='ssh key',
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -522,13 +533,7 @@ def make_rsync_deploy_steps(host, user, sshkeyfile, sshknownhostsfile, srcpath,
</span> mastersrc=sshknownhostsfile,
slavedest='ssh_known_hosts',
mode=0600),
<span style='display:block; white-space:pre;background:#ffe0e0;'>- steps.ShellCommand(
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- name='rsync',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- description='deploying',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- descriptionDone='deploy',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- command='rsync -avzhC --delay-updates --delete-delay %s/ %s@%s:%s/' % (srcpath, user, host, destpath),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- env={'RSYNC_RSH': 'ssh -i ssh_key -oUserKnownHostsFile=ssh_known_hosts'})
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ step)
</span>
if 'www' in config['deploy']:
jobs_www_factory = util.BuildFactory()
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -541,13 +546,14 @@ if 'www' in config['deploy']:
</span> workdir='build/www'))
# TODO: validate/lint files
jobs_www_factory.addSteps(
<span style='display:block; white-space:pre;background:#ffe0e0;'>- make_rsync_deploy_steps(
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- host=config['deploy']['www']['host'],
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- user=config['deploy']['www']['user'],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ make_ssh_deploy_step(
</span> sshkeyfile=config['deploy']['www']['sshkeyfile'],
sshknownhostsfile=config['deploy']['www']['sshknownhostsfile'],
<span style='display:block; white-space:pre;background:#ffe0e0;'>- srcpath='www',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- destpath=config['deploy']['www']['destpath']))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ step=RsyncDeployStep(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ host=config['deploy']['www']['host'],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ user=config['deploy']['www']['user'],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ srcpath='www',
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ destpath=config['deploy']['www']['destpath'])))
</span>
if 'portindex' in config['deploy']:
jobs_portindex_factory = util.BuildFactory()
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -579,13 +585,14 @@ if 'portindex' in config['deploy']:
</span> description=['generating'],
descriptionDone=['done']))
jobs_portindex_factory.addSteps(
<span style='display:block; white-space:pre;background:#ffe0e0;'>- make_rsync_deploy_steps(
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- host=config['deploy']['portindex']['host'],
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- user=config['deploy']['portindex']['user'],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ make_ssh_deploy_step(
</span> sshkeyfile=config['deploy']['portindex']['sshkeyfile'],
sshknownhostsfile=config['deploy']['portindex']['sshknownhostsfile'],
<span style='display:block; white-space:pre;background:#ffe0e0;'>- srcpath='PortIndex.sql',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- destpath=config['deploy']['portindex']['destpath']))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ step=RsyncDeployStep(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ host=config['deploy']['portindex']['host'],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ user=config['deploy']['portindex']['user'],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ srcpath='PortIndex.sql',
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ destpath=config['deploy']['portindex']['destpath'])))
</span>
if 'guide' in config['deploy']:
jobs_guide_factory = util.BuildFactory()
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -607,13 +614,14 @@ if 'guide' in config['deploy']:
</span> command='make all',
workdir='build/guide'))
jobs_guide_factory.addSteps(
<span style='display:block; white-space:pre;background:#ffe0e0;'>- make_rsync_deploy_steps(
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- host=config['deploy']['guide']['host'],
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- user=config['deploy']['guide']['user'],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ make_ssh_deploy_step(
</span> sshkeyfile=config['deploy']['guide']['sshkeyfile'],
sshknownhostsfile=config['deploy']['guide']['sshknownhostsfile'],
<span style='display:block; white-space:pre;background:#ffe0e0;'>- srcpath='guide',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- destpath=config['deploy']['guide']['destpath']))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ step=RsyncDeployStep(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ host=config['deploy']['guide']['host'],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ user=config['deploy']['guide']['user'],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ srcpath='guide',
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ destpath=config['deploy']['guide']['destpath'])))
</span>
####### BUILDER CONFIGURATION #######
</pre><pre style='margin:0'>
</pre>