kopia lustrzana https://github.com/jupyterhub/repo2docker
use bundled s2i by adding package to PATH
rodzic
bba7582886
commit
c158daab9d
|
@ -144,7 +144,7 @@ class Repo2Docker(Application):
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
for line in execute_cmd(['git', 'reset', '--hard', ref], checkout_path):
|
for line in execute_cmd(['git', 'reset', '--hard', ref], cwd=checkout_path):
|
||||||
self.log.info(line, extra=dict(phase='fetching'))
|
self.log.info(line, extra=dict(phase='fetching'))
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
self.log.error('Failed to check out ref %s', ref, extra=dict(phase='failed'))
|
self.log.error('Failed to check out ref %s', ref, extra=dict(phase='failed'))
|
||||||
|
|
|
@ -12,6 +12,7 @@ from pythonjsonlogger import jsonlogger
|
||||||
|
|
||||||
from .utils import execute_cmd
|
from .utils import execute_cmd
|
||||||
|
|
||||||
|
here = os.path.abspath(os.path.dirname(__file__))
|
||||||
|
|
||||||
class BuildPack(LoggingConfigurable):
|
class BuildPack(LoggingConfigurable):
|
||||||
name = Unicode()
|
name = Unicode()
|
||||||
|
@ -73,8 +74,10 @@ class S2IBuildPack(BuildPack):
|
||||||
build_image,
|
build_image,
|
||||||
output_image_spec,
|
output_image_spec,
|
||||||
]
|
]
|
||||||
|
env = os.environ.copy()
|
||||||
|
env['PATH'] = os.pathsep.join([here, env.get('PATH') or os.defpath])
|
||||||
try:
|
try:
|
||||||
for line in execute_cmd(cmd, cwd=workdir):
|
for line in execute_cmd(cmd, cwd=workdir, env=env):
|
||||||
self.log.info(line, extra=dict(phase='building', builder=self.name))
|
self.log.info(line, extra=dict(phase='building', builder=self.name))
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
self.log.error('Failed to build image!', extra=dict(phase='failed'))
|
self.log.error('Failed to build image!', extra=dict(phase='failed'))
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
def execute_cmd(cmd, cwd=None):
|
def execute_cmd(cmd, **kwargs):
|
||||||
"""
|
"""
|
||||||
Call given command, yielding output line by line
|
Call given command, yielding output line by line
|
||||||
"""
|
"""
|
||||||
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True, cwd=cwd)
|
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True, **kwargs)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
for line in iter(proc.stdout.readline, ''):
|
for line in iter(proc.stdout.readline, ''):
|
||||||
|
|
Ładowanie…
Reference in New Issue