kopia lustrzana https://github.com/jupyterhub/repo2docker
Add --label command line option
rodzic
fa512e76bd
commit
86df151414
|
@ -204,6 +204,14 @@ def get_argparser():
|
||||||
|
|
||||||
argparser.add_argument("--appendix", type=str, help=Repo2Docker.appendix.help)
|
argparser.add_argument("--appendix", type=str, help=Repo2Docker.appendix.help)
|
||||||
|
|
||||||
|
argparser.add_argument(
|
||||||
|
"--label",
|
||||||
|
dest="labels",
|
||||||
|
action="append",
|
||||||
|
help="Extra label to set on the image, in form name=value",
|
||||||
|
default=[],
|
||||||
|
)
|
||||||
|
|
||||||
argparser.add_argument("--subdir", type=str, help=Repo2Docker.subdir.help)
|
argparser.add_argument("--subdir", type=str, help=Repo2Docker.subdir.help)
|
||||||
|
|
||||||
argparser.add_argument(
|
argparser.add_argument(
|
||||||
|
@ -246,6 +254,13 @@ def make_r2d(argv=None):
|
||||||
if args.appendix:
|
if args.appendix:
|
||||||
r2d.appendix = args.appendix
|
r2d.appendix = args.appendix
|
||||||
|
|
||||||
|
for l in args.labels:
|
||||||
|
if "=" in l:
|
||||||
|
key, val = l.split("=", 1)
|
||||||
|
r2d.labels[key] = val
|
||||||
|
else:
|
||||||
|
r2d.labels[l] = ""
|
||||||
|
|
||||||
r2d.repo = args.repo
|
r2d.repo = args.repo
|
||||||
r2d.ref = args.ref
|
r2d.ref = args.ref
|
||||||
|
|
||||||
|
|
|
@ -237,6 +237,17 @@ class Repo2Docker(Application):
|
||||||
""",
|
""",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
labels = Dict(
|
||||||
|
{},
|
||||||
|
help="""
|
||||||
|
Extra labels to set on the final image.
|
||||||
|
|
||||||
|
Each Label is a key-value pair, with the key being the name of the label
|
||||||
|
and the value its value.
|
||||||
|
""",
|
||||||
|
config=True,
|
||||||
|
)
|
||||||
|
|
||||||
json_logs = Bool(
|
json_logs = Bool(
|
||||||
False,
|
False,
|
||||||
help="""
|
help="""
|
||||||
|
@ -747,6 +758,8 @@ class Repo2Docker(Application):
|
||||||
picked_buildpack.labels["repo2docker.repo"] = repo_label
|
picked_buildpack.labels["repo2docker.repo"] = repo_label
|
||||||
picked_buildpack.labels["repo2docker.ref"] = self.ref
|
picked_buildpack.labels["repo2docker.ref"] = self.ref
|
||||||
|
|
||||||
|
picked_buildpack.labels.update(self.labels)
|
||||||
|
|
||||||
if self.dry_run:
|
if self.dry_run:
|
||||||
print(picked_buildpack.render())
|
print(picked_buildpack.render())
|
||||||
else:
|
else:
|
||||||
|
|
Ładowanie…
Reference in New Issue