mirror of
https://github.com/rpm-software-management/tito.git
synced 2025-02-24 04:32:46 +00:00
Add a rsync username env variable for yum repo releaser.
This commit is contained in:
parent
4698dff21f
commit
e1eff8f63e
3 changed files with 17 additions and 4 deletions
|
@ -3,3 +3,9 @@ builder = tito.builder.MockBuilder
|
||||||
releaser = tito.release.YumRepoMockReleaser
|
releaser = tito.release.YumRepoMockReleaser
|
||||||
mock = fedora-15-x86_64
|
mock = fedora-15-x86_64
|
||||||
rsync = fedorapeople.org:/srv/repos/candlepin/subscription-manager/fedora-15/x86_64/
|
rsync = fedorapeople.org:/srv/repos/candlepin/subscription-manager/fedora-15/x86_64/
|
||||||
|
|
||||||
|
[yum-f15-i686]
|
||||||
|
builder = tito.builder.MockBuilder
|
||||||
|
releaser = tito.release.YumRepoMockReleaser
|
||||||
|
mock = fedora-15-i686
|
||||||
|
rsync = fedorapeople.org:/srv/repos/candlepin/subscription-manager/fedora-15/x86_64/
|
||||||
|
|
|
@ -794,6 +794,8 @@ class MockBuilder(Builder):
|
||||||
|
|
||||||
# TODO: error out if mock package is not installed
|
# TODO: error out if mock package is not installed
|
||||||
|
|
||||||
|
# TODO: error out if user does not have mock group
|
||||||
|
|
||||||
def _rpm(self):
|
def _rpm(self):
|
||||||
"""
|
"""
|
||||||
Uses the SRPM
|
Uses the SRPM
|
||||||
|
|
|
@ -33,6 +33,7 @@ DEFAULT_CVS_BUILD_DIR = "cvswork"
|
||||||
# List of CVS files to protect when syncing git with a CVS module:
|
# List of CVS files to protect when syncing git with a CVS module:
|
||||||
PROTECTED_BUILD_SYS_FILES = ('branch', 'CVS', '.cvsignore', 'Makefile', 'sources', ".git", ".gitignore")
|
PROTECTED_BUILD_SYS_FILES = ('branch', 'CVS', '.cvsignore', 'Makefile', 'sources', ".git", ".gitignore")
|
||||||
|
|
||||||
|
RSYNC_USERNAME = 'RSYNC_USERNAME' # environment variable name
|
||||||
|
|
||||||
class Releaser(object):
|
class Releaser(object):
|
||||||
|
|
||||||
|
@ -202,19 +203,23 @@ class YumRepoMockReleaser(Releaser):
|
||||||
print "RPMS:"
|
print "RPMS:"
|
||||||
print self.builder.artifacts
|
print self.builder.artifacts
|
||||||
|
|
||||||
# TODO: username
|
|
||||||
rsync_location = "fedorapeople.org:/srv/repos/candlepin/subscription-manager/fedora-15/x86_64/"
|
rsync_location = "fedorapeople.org:/srv/repos/candlepin/subscription-manager/fedora-15/x86_64/"
|
||||||
|
if RSYNC_USERNAME in os.environ:
|
||||||
|
print("%s set, using rsync username: %s" % (RSYNC_USERNAME,
|
||||||
|
os.environ[RSYNC_USERNAME]))
|
||||||
|
rsync_location = "%s@%s" % (os.environ[RSYNC_USERNAME], rsync_location)
|
||||||
# Make a temp directory to sync the existing repo contents into:
|
# Make a temp directory to sync the existing repo contents into:
|
||||||
yum_temp_dir = mkdtemp(dir=self.build_dir, prefix="tito-yumrepo-")
|
yum_temp_dir = mkdtemp(dir=self.build_dir, prefix="tito-yumrepo-")
|
||||||
debug("Copying existing yum repo to: %s" % yum_temp_dir)
|
print("Syncing yum repo: %s -> %s" % (rsync_location, yum_temp_dir))
|
||||||
run_command("rsync -avtz %s %s" % (rsync_location, yum_temp_dir))
|
output = run_command("rsync -avtz %s %s" % (rsync_location, yum_temp_dir))
|
||||||
|
debug(output)
|
||||||
|
|
||||||
for artifact in self.builder.artifacts:
|
for artifact in self.builder.artifacts:
|
||||||
if artifact.endswith(".rpm") and not artifact.endswith(".src.rpm"):
|
if artifact.endswith(".rpm") and not artifact.endswith(".src.rpm"):
|
||||||
copy(artifact, yum_temp_dir)
|
copy(artifact, yum_temp_dir)
|
||||||
print("Copied %s to yum repo." % artifact)
|
print("Copied %s to yum repo." % artifact)
|
||||||
|
|
||||||
# TODO: should we clean up old versions of these packages?
|
# TODO: should we clean up old versions of these packages in the repo?
|
||||||
|
|
||||||
os.chdir(yum_temp_dir)
|
os.chdir(yum_temp_dir)
|
||||||
output = run_command("createrepo ./")
|
output = run_command("createrepo ./")
|
||||||
|
|
Loading…
Add table
Reference in a new issue