1
0
Fork 0

Support for multiple upload targets

- also option to update the SCM repo
This commit is contained in:
James Turner 2015-07-27 21:40:00 -05:00
parent 242c0f9172
commit 565feadfa6
2 changed files with 10 additions and 4 deletions

View file

@ -12,7 +12,10 @@ import git_catalog_repository
import git_discrete_repository import git_discrete_repository
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument("--clean", help="Regenerate every package", type=bool) parser.add_argument("--clean", help="Regenerate every package",
action="store_true")
parser.add_argument("--update", help="Update/pull SCM source",
action="store_true")
parser.add_argument("dir", help="Catalog directory") parser.add_argument("dir", help="Catalog directory")
args = parser.parse_args() args = parser.parse_args()
@ -117,6 +120,8 @@ mirrorUrls = []
existingCatalogPath = os.path.join(outPath, 'catalog.xml') existingCatalogPath = os.path.join(outPath, 'catalog.xml')
scmRepo = initScmRepository(config.getChild('scm')) scmRepo = initScmRepository(config.getChild('scm'))
if args.update:
scmRepo.update()
# scan the directories in the aircraft paths # scan the directories in the aircraft paths
for g in config.getChildren("aircraft-dir"): for g in config.getChildren("aircraft-dir"):
@ -187,5 +192,5 @@ for p in packages.values():
catalogNode.write(os.path.join(outPath, "catalog.xml")) catalogNode.write(os.path.join(outPath, "catalog.xml"))
print "Uploading" print "Uploading"
if config.hasChild("upload"): for up in config.getChildren("upload"):
processUpload(config.getChild("upload"), outPath) processUpload(up, outPath)

View file

@ -24,4 +24,5 @@ class SVNCatalogRepository:
return commit.get('revision', 0) return commit.get('revision', 0)
def update(self): def update(self):
subprocess.call(["svn", "update"]) print "SVN update of", self._path
subprocess.call(["svn", "update", self._path])