kopia lustrzana https://github.com/jupyterhub/repo2docker
Make s2i builder work on non-master refs
rodzic
e81bfe8c89
commit
cf6674cce8
|
@ -120,7 +120,7 @@ class Builder(Application):
|
||||||
bp = bp_class()
|
bp = bp_class()
|
||||||
if bp.detect(output_path):
|
if bp.detect(output_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(output_path, self.output_image_spec)
|
bp.build(output_path, self.source_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'))
|
||||||
|
|
|
@ -32,7 +32,7 @@ class BuildPack(LoggingConfigurable):
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def build(self, workdir, output_image_spec):
|
def build(self, workdir, ref, output_image_spec):
|
||||||
"""
|
"""
|
||||||
Run a command that will take workdir and produce an image ready to be pushed
|
Run a command that will take workdir and produce an image ready to be pushed
|
||||||
"""
|
"""
|
||||||
|
@ -45,7 +45,7 @@ class DockerBuildPack(BuildPack):
|
||||||
def detect(self, workdir):
|
def detect(self, workdir):
|
||||||
return os.path.exists(os.path.join(workdir, 'Dockerfile'))
|
return os.path.exists(os.path.join(workdir, 'Dockerfile'))
|
||||||
|
|
||||||
def build(self, workdir, output_image_spec):
|
def build(self, workdir, ref, output_image_spec):
|
||||||
client = docker.APIClient(base_url='unix://var/run/docker.sock', version='auto')
|
client = docker.APIClient(base_url='unix://var/run/docker.sock', version='auto')
|
||||||
for progress in client.build(
|
for progress in client.build(
|
||||||
path=workdir,
|
path=workdir,
|
||||||
|
@ -77,11 +77,15 @@ class PythonBuildPack(BuildPack):
|
||||||
pass
|
pass
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def build(self, workdir, output_image_spec):
|
def build(self, workdir, ref, output_image_spec):
|
||||||
|
# Note: Ideally we'd just copy from workdir here, rather than clone and check out again
|
||||||
|
# However, setting just --copy and not specifying a ref seems to check out master for
|
||||||
|
# some reason. Investigate deeper FIXME
|
||||||
cmd = [
|
cmd = [
|
||||||
's2i',
|
's2i',
|
||||||
'build',
|
'build',
|
||||||
'--exclude', '""',
|
'--exclude', '""',
|
||||||
|
'--ref', ref,
|
||||||
workdir,
|
workdir,
|
||||||
self.runtime_builder_map[self.runtime],
|
self.runtime_builder_map[self.runtime],
|
||||||
output_image_spec
|
output_image_spec
|
||||||
|
|
Ładowanie…
Reference in New Issue