Use REPO_DIR rather than REPO_PATH
is a good justification
MODIFY
repo2docker/__main__.py
repo2docker/__main__.py
@@ -169,8 +169,8 @@ def get_argparser():
)
argparser.add_argument(
- '--repo-path',
- help=Repo2Docker.repo_path.help
+ '--target-repo-dir',
+ help=Repo2Docker.target_repo_dir.help
)
argparser.add_argument(
@@ -321,8 +321,8 @@ def make_r2d(argv=None):
else:
r2d.cleanup_checkout = args.clean
- if args.repo_path:
- r2d.repo_path = args.repo_path
+ if args.target_repo_dir:
+ r2d.target_repo_dir = args.target_repo_dir
return r2d

MODIFY
repo2docker/app.py
repo2docker/app.py
@@ -327,7 +327,7 @@ class Repo2Docker(Application):
config=True
)
- repo_path = Unicode(
+ target_repo_dir = Unicode(
'',
help="""
Path inside the image where contents of the repositories are copied to.
@@ -605,8 +605,8 @@ class Repo2Docker(Application):
'NB_USER': self.user_name,
'NB_UID': str(self.user_id),
}
- if self.repo_path:
- build_args['REPO_PATH'] = self.repo_path
+ if self.target_repo_dir:
+ build_args['REPO_DIR'] = self.target_repo_dir
self.log.info('Using %s builder\n', bp.__class__.__name__,
extra=dict(phase='building'))

MODIFY
repo2docker/buildpacks/base.py
repo2docker/buildpacks/base.py
@@ -98,15 +98,15 @@ COPY {{ src }} {{ dst }}
{% endfor %}
# Allow target path repo is cloned to be configurable
-ARG REPO_PATH=${HOME}
-ENV REPO_PATH ${REPO_PATH}
-WORKDIR ${REPO_PATH}
+ARG REPO_DIR=${HOME}
+ENV REPO_DIR ${REPO_DIR}
+WORKDIR ${REPO_DIR}
# Copy and chown stuff. This doubles the size of the repo, because
# you can't actually copy as USER, only as root! Thanks, Docker!
USER root
-COPY src/ ${REPO_PATH}
-RUN chown -R ${NB_USER}:${NB_USER} ${REPO_PATH}
+COPY src/ ${REPO_DIR}
+RUN chown -R ${NB_USER}:${NB_USER} ${REPO_DIR}
{% if env -%}
# The rest of the environment
@@ -529,7 +529,7 @@ class BaseImage(BuildPack):
archive_dir, archive = os.path.split(self.stencila_manifest_dir)
env.extend([
- ("STENCILA_ARCHIVE_DIR", "${REPO_PATH}/" + archive_dir),
+ ("STENCILA_ARCHIVE_DIR", "${REPO_DIR}/" + archive_dir),
("STENCILA_ARCHIVE", archive),
])
return env

MODIFY
tests/venv/repo-path/extra-args.yaml
tests/venv/repo-path/extra-args.yaml
-- --repo-path
+- --target-repo-dir
- /srv/repo
\ No newline at end of file

Use REPO_DIR rather than REPO_PATH

https://github.com/jupyter/repo2docker/pull/507#issuecomment-448184651
is a good justification