This is an automated email from the ASF dual-hosted git repository.
granthenke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
The following commit(s) were added to refs/heads/master by this push:
new 56c0132 [docker] Add option to force the latest tag
56c0132 is described below
commit 56c0132aa4a1f372d13213c150c4bbca23c0efbc
Author: Grant Henke <[email protected]>
AuthorDate: Thu Jun 10 08:54:15 2021 -0500
[docker] Add option to force the latest tag
This patch adds a `--force-latest` that allows users to force
using the simple `latest` tag even when the default base OS
is not used. This is useful because the latest tag is often
used to retrieve the last relevant build and is commonly used
when a user just wants to test or use their latest build.
For example if a user wants to test the quickstart with CentOS 7
they can build with `--force-latest` and run normally as opposed
to manually editing the quickstart.yml file.
This is also useful for CI/CD pipelines that always want to publish
the last build image as `latest`.
Change-Id: I13ff38683d3f923577f8728fdf30a4b3e09bc943
Reviewed-on: http://gerrit.cloudera.org:8080/17574
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <[email protected]>
---
docker/docker-build.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/docker/docker-build.py b/docker/docker-build.py
index dc7ee9e..6f66d22 100755
--- a/docker/docker-build.py
+++ b/docker/docker-build.py
@@ -114,9 +114,12 @@ def parse_args():
'images to docker so they can be used locally.
"push" will push the '
'images to the registry.')
+ parser.add_argument('--force-latest', action='store_true',
+ help='If passed, forces adding the simple `latest` tag
even though the base '
+ 'image is not the default OS')
parser.add_argument('--skip-latest', action='store_true',
help='If passed, skips adding a tag using `-latest`
along with the '
- 'versioned tag')
+ 'versioned tag. Note: This overrides the --force-latest
tag above.')
parser.add_argument('--tag-hash', action='store_true',
help='If passed, keeps the tags using the short git hash
as the version '
'for non-release builds. Leaving this as false ensures
the tags '
@@ -281,7 +284,7 @@ def build_tags(opts, runtime_base, dev_base, version,
vcs_ref, target):
latest_tag = get_full_tag(opts.repository, target, 'latest', os_tag)
tags.append(latest_tag)
# Add the default OS tag.
- if base == DEFAULT_OS:
+ if base == DEFAULT_OS or opts.force_latest:
latest_default_os_tag = get_full_tag(opts.repository, target, 'latest',
'')
tags.append(latest_default_os_tag)