kopia lustrzana https://github.com/jupyterhub/repo2docker
Allow setting REPO_PATH from commandline
rodzic
0f3076387a
commit
8b26bbe4e0
|
@ -168,6 +168,11 @@ def get_argparser():
|
||||||
help='Use the local repository in edit mode',
|
help='Use the local repository in edit mode',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
argparser.add_argument(
|
||||||
|
'--repo-path',
|
||||||
|
help=Repo2Docker.repo_path.help
|
||||||
|
)
|
||||||
|
|
||||||
argparser.add_argument(
|
argparser.add_argument(
|
||||||
'--appendix',
|
'--appendix',
|
||||||
type=str,
|
type=str,
|
||||||
|
@ -316,6 +321,9 @@ def make_r2d(argv=None):
|
||||||
else:
|
else:
|
||||||
r2d.cleanup_checkout = args.clean
|
r2d.cleanup_checkout = args.clean
|
||||||
|
|
||||||
|
if args.repo_path:
|
||||||
|
r2d.repo_path = args.repo_path
|
||||||
|
|
||||||
return r2d
|
return r2d
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -327,6 +327,16 @@ class Repo2Docker(Application):
|
||||||
config=True
|
config=True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
repo_path = Unicode(
|
||||||
|
'$HOME',
|
||||||
|
help="""
|
||||||
|
Path inside the image where contents of the repositories are copied to.
|
||||||
|
|
||||||
|
Build arguments in this are expanded.
|
||||||
|
""",
|
||||||
|
config=True
|
||||||
|
)
|
||||||
|
|
||||||
def fetch(self, url, ref, checkout_path):
|
def fetch(self, url, ref, checkout_path):
|
||||||
"""Fetch the contents of `url` and place it in `checkout_path`.
|
"""Fetch the contents of `url` and place it in `checkout_path`.
|
||||||
|
|
||||||
|
@ -593,7 +603,8 @@ class Repo2Docker(Application):
|
||||||
if not self.dry_run:
|
if not self.dry_run:
|
||||||
build_args = {
|
build_args = {
|
||||||
'NB_USER': self.user_name,
|
'NB_USER': self.user_name,
|
||||||
'NB_UID': str(self.user_id)
|
'NB_UID': str(self.user_id),
|
||||||
|
'REPO_PATH': self.repo_path
|
||||||
}
|
}
|
||||||
self.log.info('Using %s builder\n', bp.__class__.__name__,
|
self.log.info('Using %s builder\n', bp.__class__.__name__,
|
||||||
extra=dict(phase='building'))
|
extra=dict(phase='building'))
|
||||||
|
|
Ładowanie…
Reference in New Issue