Split 'build' function out of start

pull/496/head
yuvipanda 2018-12-11 12:36:06 -08:00
rodzic cd04da56fc
commit ac700c49be
2 zmienionych plików z 15 dodań i 5 usunięć

Wyświetl plik

@ -237,15 +237,18 @@ def make_r2d(argv=None):
if args.image_name:
r2d.output_image_spec = args.image_name
r2d.push = args.push
r2d.run = args.run
r2d.json_logs = args.json_logs
r2d.build = args.build
if not r2d.build:
if not args.build:
# Can't push nor run if we aren't building
r2d.run = False
r2d.push = False
args.run = False
args.push = False
r2d.build = args.build
r2d.run = args.run
r2d.push = args.push
# check against r2d.run and not args.run as r2d.run is false on
# --no-build

Wyświetl plik

@ -551,6 +551,10 @@ class Repo2Docker(Application):
raise e
sys.exit(1)
def build(self):
"""
Build docker image
"""
# If the source to be executed is a directory, continue using the
# directory. In the case of a local directory, it is used as both the
# source and target. Reusing a local directory seems better than
@ -620,6 +624,9 @@ class Repo2Docker(Application):
if self.cleanup_checkout:
shutil.rmtree(checkout_path, ignore_errors=True)
def start(self):
self.build()
if self.push:
self.push_image()