mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[FIX] runbot: removing failed git export
When a git archive fails, the partially exported source tree is left in place. If another builds tries to use the same commit, the tree is not exported anymore as the directory exists. This leads to non deterministic behaviors.
This commit is contained in:
parent
8cdb8c9e5b
commit
ffd432311f
@ -79,8 +79,12 @@ class Commit(models.Model):
|
||||
(_, err) = p2.communicate()
|
||||
p1.poll() # fill the returncode
|
||||
if p1.returncode:
|
||||
_logger.info("git export: removing corrupted export %r", export_path)
|
||||
shutil.rmtree(export_path)
|
||||
raise RunbotException("Git archive failed for %s with error code %s. (%s)" % (self.name, p1.returncode, p1.stderr.read().decode()))
|
||||
if err:
|
||||
_logger.info("git export: removing corrupted export %r", export_path)
|
||||
shutil.rmtree(export_path)
|
||||
raise RunbotException("Export for %s failed. (%s)" % (self.name, err))
|
||||
|
||||
if self.rebase_on_id:
|
||||
|
Loading…
Reference in New Issue
Block a user