Skip to content

Commit

Permalink
use the consul-aws.version LABEL
Browse files Browse the repository at this point in the history
  • Loading branch information
alvin-huang committed Apr 23, 2019
1 parent a7e91f0 commit b5a959c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build-support/docker/Release.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ENV VERSION=$VERSION
ENV HASHICORP_RELEASES=https://releases.hashicorp.com

# Add a label for introspection of version
LABEL version=$VERSION
LABEL consul-aws.version=$VERSION

# Create a non-root user to run the software.
RUN addgroup ${NAME} && \
Expand Down
4 changes: 2 additions & 2 deletions build-support/scripts/publish-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function get_latest_docker_version {
# 0 - success (version in the 'latest' container echoed)
# 1 - 'latest' tag does not exist or label could not be found

docker_latest=$(docker inspect --format='{{ index .Config.Labels "version" }}' "$1"/"$2":latest 2> /dev/null)
docker_latest=$(docker inspect --format='{{ index .Config.Labels "consul-aws.version" }}' "$1"/"$2":latest 2> /dev/null)

if [ -z "$docker_latest" ]; then
return 1
Expand All @@ -38,7 +38,7 @@ function get_latest_docker_minor_version {
# Returns:
# 0 - success (version in the latest minor version container echoed)
# 1 - tag does not exist or label could not be found
docker_latest_minor=$(docker inspect --format='{{ index .Config.Labels "version" }}' "$1"/"$2":"$3" 2> /dev/null)
docker_latest_minor=$(docker inspect --format='{{ index .Config.Labels "consul-aws.version" }}' "$1"/"$2":"$3" 2> /dev/null)

if [ -z "$docker_latest_minor" ]; then
return 1
Expand Down

0 comments on commit b5a959c

Please sign in to comment.