Ajout des points d'insertions [ARCH] et [PROFILE] pour la commande passée au drapeau override-docker-args

This commit is contained in:
wpetit 2017-07-17 17:54:25 +02:00
parent 110097ec81
commit 422407a37c
1 changed files with 3 additions and 1 deletions

View File

@ -21,7 +21,7 @@ def create_args_parser():
parser.add_argument("--rebuild", help="Ignore cache and rebuild container's image", action="store_true", default=False) parser.add_argument("--rebuild", help="Ignore cache and rebuild container's image", action="store_true", default=False)
parser.add_argument("--debug", help="Will add extra output and start the container in interactive mode", action="store_true", default=False) parser.add_argument("--debug", help="Will add extra output and start the container in interactive mode", action="store_true", default=False)
parser.add_argument("--cleanup", help="Clear the workspace and remove obsolete Docker images before build", action="store_true", default=False) parser.add_argument("--cleanup", help="Clear the workspace and remove obsolete Docker images before build", action="store_true", default=False)
parser.add_argument("--override-docker-args", help="Override all 'docker run' arguments. Use '[IMAGE_TAG]' to insert the generated image's name.", default="") parser.add_argument("--override-docker-args", help="Override all 'docker run' arguments. Use '[IMAGE_TAG]', '[PROFILE]' and '[ARCH]' to insert the corresponding values into your command.", default="")
return parser return parser
@ -91,6 +91,8 @@ if __name__ == "__main__":
# Append custom arguments # Append custom arguments
if args.override_docker_args != "": if args.override_docker_args != "":
docker_args = args.override_docker_args.replace('[IMAGE_TAG]', image_tag) docker_args = args.override_docker_args.replace('[IMAGE_TAG]', image_tag)
docker_args = args.override_docker_args.replace('[PROFILE]', args.profile)
docker_args = args.override_docker_args.replace('[ARCH]', args.architecture)
else: else:
docker_args += [ "run", "--rm" ] docker_args += [ "run", "--rm" ]