diff options
author | Alex Bennée <alex.bennee@linaro.org> | 2021-05-12 11:20:25 +0100 |
---|---|---|
committer | Alex Bennée <alex.bennee@linaro.org> | 2021-05-18 09:35:39 +0100 |
commit | c3ad904393c169a5240b3ac58a37ef953b678c02 (patch) | |
tree | 918393a4008be8f3203dd75862178afa18ffc833 | |
parent | bf46c0eed345714044080539b7d17707dc8e3f2e (diff) |
tests/docker: add "fetch" sub-command
This simply wraps up fetching a build from the registry and tagging it
as the local build.
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210512102051.12134-6-alex.bennee@linaro.org>
-rwxr-xr-x | tests/docker/docker.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/docker/docker.py b/tests/docker/docker.py index 7a14058801..4d9bb7c7ed 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -515,6 +515,23 @@ class BuildCommand(SubCommand): return 0 +class FetchCommand(SubCommand): + """ Fetch a docker image from the registry. Args: <tag> <registry>""" + name = "fetch" + + def args(self, parser): + parser.add_argument("tag", + help="Local tag for image") + parser.add_argument("registry", + help="Docker registry") + + def run(self, args, argv): + dkr = Docker() + dkr.command(cmd="pull", quiet=args.quiet, + argv=["%s/%s" % (args.registry, args.tag)]) + dkr.command(cmd="tag", quiet=args.quiet, + argv=["%s/%s" % (args.registry, args.tag), args.tag]) + class UpdateCommand(SubCommand): """ Update a docker image. Args: <tag> <actions>""" |