Skip to content

Commit

Permalink
Add -R option to ci/build.py to avoid rebuilding containers
Browse files Browse the repository at this point in the history
There are a couple of problems which trigger continuous rebuild of the containers which have difficult solutions, this option enables a workaround.
docker/docs#8886
  • Loading branch information
larroy committed Jul 3, 2019
1 parent 5078853 commit 717dd24
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ci/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,10 @@ def main() -> int:
help="Only build the container, don't build the project",
action='store_true')

parser.add_argument("-R", "--run-only",
help="Only run the container, don't rebuild the container",
action='store_true')

parser.add_argument("-a", "--all",
help="build for all platforms",
action='store_true')
Expand Down Expand Up @@ -492,8 +496,12 @@ def signal_handler(signum, _):
tag = get_docker_tag(platform=platform, registry=args.docker_registry)
if args.docker_registry:
load_docker_cache(tag=tag, docker_registry=args.docker_registry)
build_docker(platform=platform, docker_binary=docker_binary, registry=args.docker_registry,
if not args.run_only:
build_docker(platform=platform, docker_binary=docker_binary, registry=args.docker_registry,
num_retries=args.docker_build_retries, no_cache=args.no_cache)
else:
logging.info("Skipping docker build step.")

if args.build_only:
logging.warning("Container was just built. Exiting due to build-only.")
return 0
Expand Down

0 comments on commit 717dd24

Please sign in to comment.