Skip to content

Commit

Permalink
make option --pull optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernd Doser committed May 4, 2018
1 parent cc7ce78 commit f6482a3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ def build_images(image_type, image_list, args, docker_push):
base = '-'.join(image[:-1])
module = image[-1:][0]

cmd = 'docker build --pull'
cmd = 'docker build'
if args.pull:
cmd += ' --pull'
if args.no_cache:
cmd += ' --no-cache'
cmd += ' -t braintwister/' + image_name
Expand Down Expand Up @@ -81,6 +83,7 @@ def main():
parser.add_argument('-u', '--user', help='Username for docker repository')
parser.add_argument('-p', '--password', help='Password for docker repository')
parser.add_argument('--no-cache', action="store_true", help='Do not use cache when building the image')
parser.add_argument('--pull', action="store_true", help='Always attempt to pull a newer version of the image')

args = parser.parse_args()
image_list = yaml.load(open(args.images, 'r'));
Expand Down

0 comments on commit f6482a3

Please sign in to comment.