from buildbot.config.builder import BuilderConfig
from buildbot.steps.master import Assert
from buildbot.steps.source.git import Git
-from buildbot.steps.shell import ShellCommand
+from buildbot.steps.shell import SetPropertyFromCommand, ShellCommand
from buildbot.steps.shellsequence import ShellSequence, ShellArg
from buildbot.steps.trigger import Trigger
from buildbot.process.factory import BuildFactory
factory=BuildFactory([
Git(repourl='lin0:'+localrepo,
filters=["tree:0"]),
+ SetPropertyFromCommand(
+ command=["sh","-c","rev=`git rev-parse HEAD`; echo ${rev:0:6}"],
+ property="shortrev",
+ haltOnFailure=True,
+ ),
ShellCommand(
name="lint",
command=["cargo","clippy","--no-deps","--","-D","warnings"],
haltOnFailure=True,logname="step"),
ShellArg(command=["rm","-f","waterslager.tar.gz"],
haltOnFailure=True,logname="step"),
- ShellArg(command=["tar","czf","waterslager.tar.gz","waterslager"],
+ ShellArg(command=["tar","czf",util.Interpolate("waterslager-%(prop:shortrev)s.tar.gz"),"waterslager"],
haltOnFailure=True,logname="step"),
],
haltOnFailure=True,
ShellSequence(
name="copy waterslager to sra0",
commands=[
- ShellArg(command=["scp","waterslager.tar.gz","sra0:~"],
+ ShellArg(command=["scp",util.Interpolate("waterslager-%(prop:shortrev)s.tar.gz"),"sra0:~"],
+ haltOnFailure=True,logname="step"),
+ ShellArg(command=["ssh","sra0","rm","-f","waterslager-latest.tar.gz"],
+ haltOnFailure=True,logname="step"),
+ ShellArg(command=["ssh","sra0","ln","-s",util.Interpolate("waterslager-%(prop:shortrev)s.tar.gz"),"waterslager-latest.tar.gz"],
haltOnFailure=True,logname="step"),
],
haltOnFailure=True,