- self.prod = deploy.ProductionCopy(".")
- self.repo = self.prod.application.repository(options.srv_path)
- # XXX: put this in Application
- self.version = shell.eval("git", "--git-dir="+self.repo, "describe", "--tags", "master")
- self.preflightBlacklist()
- self.prod.verify()
- self.prod.verifyTag(options.srv_path)
- self.prod.verifyGit(options.srv_path)
- self.prod.verifyConfigured()
- shell.call("git", "fetch", "--tags") # XXX: hack since some installs have stale tags
- self.prod.verifyVersion()
+ while True:
+ self.prod = deploy.ProductionCopy(".")
+ self.repo = self.prod.application.repository(options.srv_path)
+ # XXX: put this in Application
+ self.version = shell.eval("git", "--git-dir="+self.repo, "describe", "--tags", "master")
+ self.preflightBlacklist()
+ self.prod.verify()
+ self.prod.verifyTag(options.srv_path)
+ self.prod.verifyGit(options.srv_path)
+ self.prod.verifyConfigured()
+ shell.call("git", "fetch", "--tags") # XXX: hack since some installs have stale tags
+ try:
+ self.prod.verifyVersion()
+ except deploy.VersionMismatchError as e:
+ # XXX: kind of hacky, mainly it does change the Git working copy
+ # state (although /very/ non-destructively)
+ shell.call("git", "merge", "--strategy=ours", self.prod.application.makeVersion(str(e.real_version)).scripts_tag)
+ continue
+ break