pull/413/head
Derek Ludwig 2018-09-12 14:43:36 -07:00
rodzic ff46dbdbf8
commit da5e84472a
1 zmienionych plików z 20 dodań i 1 usunięć

Wyświetl plik

@ -62,6 +62,16 @@ class Repo2Docker(Application):
"""
)
subdir = Unicode(
'',
config=True,
help="""
Subdirectory of the git repository to examine.
Defaults to ''.
"""
)
buildpacks = List(
[
LegacyBinderDockerBuildPack,
@ -345,6 +355,12 @@ class Repo2Docker(Application):
help=self.traits()['appendix'].help,
)
argparser.add_argument(
'--subdir',
type=str,
help=self.traits()['subdir'].help,
)
argparser.add_argument(
'--version',
dest='version',
@ -482,6 +498,9 @@ class Repo2Docker(Application):
'the container')
sys.exit(1)
if args.subdir:
self.subdir = args.subdir
self.environment = args.environment
def push_image(self):
@ -644,7 +663,7 @@ class Repo2Docker(Application):
if self.repo_type == 'remote':
self.fetch(self.repo, self.ref, checkout_path)
os.chdir(checkout_path)
os.chdir(os.path.join(checkout_path, self.subdir).rstrip('/'))
for BP in self.buildpacks:
bp = BP()