kopia lustrzana https://github.com/jupyterhub/repo2docker
Split 'build' function out of start
rodzic
cd04da56fc
commit
ac700c49be
|
@ -237,15 +237,18 @@ def make_r2d(argv=None):
|
||||||
if args.image_name:
|
if args.image_name:
|
||||||
r2d.output_image_spec = 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.json_logs = args.json_logs
|
||||||
|
|
||||||
r2d.build = args.build
|
r2d.build = args.build
|
||||||
if not r2d.build:
|
|
||||||
|
if not args.build:
|
||||||
# Can't push nor run if we aren't building
|
# Can't push nor run if we aren't building
|
||||||
r2d.run = False
|
args.run = False
|
||||||
r2d.push = 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
|
# check against r2d.run and not args.run as r2d.run is false on
|
||||||
# --no-build
|
# --no-build
|
||||||
|
|
|
@ -551,6 +551,10 @@ class Repo2Docker(Application):
|
||||||
raise e
|
raise e
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
def build(self):
|
||||||
|
"""
|
||||||
|
Build docker image
|
||||||
|
"""
|
||||||
# If the source to be executed is a directory, continue using the
|
# 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
|
# directory. In the case of a local directory, it is used as both the
|
||||||
# source and target. Reusing a local directory seems better than
|
# source and target. Reusing a local directory seems better than
|
||||||
|
@ -620,6 +624,9 @@ class Repo2Docker(Application):
|
||||||
if self.cleanup_checkout:
|
if self.cleanup_checkout:
|
||||||
shutil.rmtree(checkout_path, ignore_errors=True)
|
shutil.rmtree(checkout_path, ignore_errors=True)
|
||||||
|
|
||||||
|
def start(self):
|
||||||
|
self.build()
|
||||||
|
|
||||||
if self.push:
|
if self.push:
|
||||||
self.push_image()
|
self.push_image()
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue