Skip to content

Commit

Permalink
kci_docker: Enable adding version to image tag
Browse files Browse the repository at this point in the history
Introduce --image-version/-V to specify image version which will be
added at the end of the image tag.

Signed-off-by: Michal Galka <michal.galka@collabora.com>
  • Loading branch information
Michal Galka authored and mgalka committed Dec 26, 2022
1 parent 25dd039 commit faffa51
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config/docker/kci_docker
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ def _dump_push_log(log):
def main(args):
base_name = args.prefix + args.image
tag_strings = ([args.arch] if args.arch else []) + (args.fragment or [])
if args.image_version:
tag_strings.append(args.image_version)
tag_name = '-'.join(tag_strings)

name = ':'.join((base_name, tag_name)) if tag_name else base_name
if args.command == 'name':
print(name)
Expand Down Expand Up @@ -123,6 +126,8 @@ if __name__ == '__main__':
help="Docker image name, e.g. gcc-10:x86")
parser.add_argument('--prefix', default='kernelci/',
help="Docker image tag prefix")
parser.add_argument('--image-version', '-V',
help='Docker image version tag e.g. 20221011.0')
parser.add_argument('--arch',
help="CPU architecture, e.g. x86")
parser.add_argument('--fragment', action='append',
Expand Down

0 comments on commit faffa51

Please sign in to comment.