mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 14:53:43 +01:00
ci: Retry image building once on failure
The build scripts inside the image retry after a failure. However, there may be some rare network failures inside the container engine. For example, when pulling the underlying base image, or when pulling the docker cache. Thus, retry after a failure once, which should hopefully fix https://github.com/bitcoin/bitcoin/issues/33640.
This commit is contained in:
@@ -7,6 +7,7 @@ import os
|
||||
import shlex
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
|
||||
|
||||
def run(cmd, **kwargs):
|
||||
@@ -65,7 +66,10 @@ def main():
|
||||
cmd_build += [os.environ["BASE_READ_ONLY_DIR"]]
|
||||
|
||||
print(f"Building {os.environ['CONTAINER_NAME']} image tag to run in")
|
||||
run(cmd_build)
|
||||
if run(cmd_build, check=False).returncode != 0:
|
||||
print(f"Retry building {os.environ['CONTAINER_NAME']} image tag after failure")
|
||||
time.sleep(3)
|
||||
run(cmd_build)
|
||||
|
||||
run(["./ci/test/02_run_container.sh"]) # run the remainder
|
||||
|
||||
|
||||
Reference in New Issue
Block a user