kopia lustrzana https://github.com/jupyterhub/repo2docker
Rename source_url and source_ref to repo and ref
Makes more sense, and also now consistent with the repository namepull/6/head
rodzic
310bc0fbfe
commit
13226e1f27
|
@ -28,16 +28,18 @@ class Repo2Docker(Application):
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
source_url = Unicode(
|
repo = Unicode(
|
||||||
None,
|
'.',
|
||||||
allow_none=True,
|
allow_none=True,
|
||||||
config=True,
|
config=True,
|
||||||
help="""
|
help="""
|
||||||
URL to the git repository to clone.
|
The git repository to clone.
|
||||||
|
|
||||||
|
Could be a https URL, or a file path.
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
source_ref = Unicode(
|
ref = Unicode(
|
||||||
'master',
|
'master',
|
||||||
allow_none=True,
|
allow_none=True,
|
||||||
config=True,
|
config=True,
|
||||||
|
@ -90,8 +92,8 @@ class Repo2Docker(Application):
|
||||||
)
|
)
|
||||||
|
|
||||||
aliases = Dict({
|
aliases = Dict({
|
||||||
'source': 'Repo2Docker.source_url',
|
'repo': 'Repo2Docker.repo',
|
||||||
'ref': 'Repo2Docker.source_ref',
|
'ref': 'Repo2Docker.ref',
|
||||||
'image': 'Repo2Docker.output_image_spec',
|
'image': 'Repo2Docker.output_image_spec',
|
||||||
'clean': 'Repo2Docker.cleanup_checkout',
|
'clean': 'Repo2Docker.cleanup_checkout',
|
||||||
'f': 'Repo2Docker.config_file',
|
'f': 'Repo2Docker.config_file',
|
||||||
|
@ -151,15 +153,15 @@ class Repo2Docker(Application):
|
||||||
|
|
||||||
checkout_path = os.path.join(self.git_workdir, str(uuid.uuid4()))
|
checkout_path = os.path.join(self.git_workdir, str(uuid.uuid4()))
|
||||||
self.fetch(
|
self.fetch(
|
||||||
self.source_url,
|
self.repo,
|
||||||
self.source_ref,
|
self.ref,
|
||||||
checkout_path
|
checkout_path
|
||||||
)
|
)
|
||||||
for bp_class in self.buildpacks:
|
for bp_class in self.buildpacks:
|
||||||
bp = bp_class()
|
bp = bp_class()
|
||||||
if bp.detect(checkout_path):
|
if bp.detect(checkout_path):
|
||||||
self.log.info('Using %s builder', bp.name, extra=dict(phase='building'))
|
self.log.info('Using %s builder', bp.name, extra=dict(phase='building'))
|
||||||
bp.build(checkout_path, self.source_ref, self.output_image_spec)
|
bp.build(checkout_path, self.ref, self.output_image_spec)
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
self.log.error('Could not figure out how to build this repository! Tell us?', extra=dict(phase='failed'))
|
self.log.error('Could not figure out how to build this repository! Tell us?', extra=dict(phase='failed'))
|
||||||
|
|
Ładowanie…
Reference in New Issue