mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
Fail early if container pull or build fail
This commit is contained in:
parent
791d930a55
commit
e3069e9e05
1 changed files with 12 additions and 2 deletions
|
@ -61,7 +61,12 @@ class PullImageTask(TaskBase):
|
||||||
self.update_label.emit("Pulling container image")
|
self.update_label.emit("Pulling container image")
|
||||||
self.update_details.emit("")
|
self.update_details.emit("")
|
||||||
args = ["pull", "ubuntu:20.04"]
|
args = ["pull", "ubuntu:20.04"]
|
||||||
self.exec_container(args, watch="stderr")
|
returncode, _ = self.exec_container(args, watch="stderr")
|
||||||
|
|
||||||
|
if returncode != 0:
|
||||||
|
self.task_failed.emit(f"Return code: {returncode}")
|
||||||
|
return
|
||||||
|
|
||||||
self.task_finished.emit()
|
self.task_finished.emit()
|
||||||
|
|
||||||
|
|
||||||
|
@ -75,7 +80,12 @@ class BuildContainerTask(TaskBase):
|
||||||
self.update_label.emit("Building container")
|
self.update_label.emit("Building container")
|
||||||
self.update_details.emit("")
|
self.update_details.emit("")
|
||||||
args = ["build", "-t", "dangerzone", container_path]
|
args = ["build", "-t", "dangerzone", container_path]
|
||||||
self.exec_container(args)
|
returncode, _ = self.exec_container(args)
|
||||||
|
|
||||||
|
if returncode != 0:
|
||||||
|
self.task_failed.emit(f"Return code: {returncode}")
|
||||||
|
return
|
||||||
|
|
||||||
self.task_finished.emit()
|
self.task_finished.emit()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue