Split 'build' function out of start
MODIFY
repo2docker/__main__.py
repo2docker/__main__.py
@@ -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

MODIFY
repo2docker/app.py
repo2docker/app.py
@@ -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()

Split 'build' function out of start