Rollback prestable part on failed testing

This commit is contained in:
Mikhail f. Shiryaev 2022-05-18 00:54:03 +02:00
parent 6cedd2f671
commit 3b1c858bff
No known key found for this signature in database
GPG Key ID: 4B02ED204C7D93F4

View File

@ -121,8 +121,16 @@ class Release:
else:
logging.info("Skipping prestable stage")
with self.testing():
logging.info("Testing part of the releasing is done")
rollback = self._rollback_stack.copy()
try:
with self.testing():
logging.info("Testing part of the releasing is done")
except (Exception, KeyboardInterrupt):
logging.fatal("Testing part failed, rollback previous steps")
rollback.reverse()
for cmd in rollback:
self.run(cmd)
raise
elif self.release_type in self.SMALL:
with self.stable():