Allow using RSYNC_USERNAME env var

This commit is contained in:
Daniel Berteaud 2018-10-01 09:29:28 +02:00
parent 94af182f3c
commit 0e72e6adf9
1 changed files with 4 additions and 0 deletions

View File

@ -50,6 +50,10 @@ class RsyncSRPMSReleaser(RsyncReleaser):
rsync = self.releaser_config.get(self.target, 'rsync').split(" ")
for destination in rsync:
if RSYNC_USERNAME in os.environ:
print("%s set, using rsync username: %s" % (RSYNC_USERNAME,
os.environ[RSYNC_USERNAME]))
destination = "%s@%s" % (os.environ[RSYNC_USERNAME], destination)
for artifact in self.builder.artifacts:
if artifact.endswith('.src.rpm'):
cmd = "rsync %s %s %s" % (self.rsync_args, artifact, destination)