Skip to content

Commit

Permalink
Using release for version tags (#92)
Browse files Browse the repository at this point in the history
* Using release for version tags

* change handling like others
  • Loading branch information
pvizeli authored Apr 15, 2021
1 parent b77028a commit fda1b6e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,12 @@ function run_build() {
local push_images=()
local cache_tag="latest"
local metadata
local release="${version}"

# Overwrites
if bashio::var.has_value "${DOCKER_HUB}"; then repository="${DOCKER_HUB}"; fi
if bashio::var.has_value "${IMAGE}"; then image="${IMAGE}"; fi
if bashio::var.has_value "${RELEASE}"; then release="${RELEASE}"; fi

# Replace {arch} with build arch for image
# shellcheck disable=SC1117
Expand Down Expand Up @@ -266,9 +268,9 @@ function run_build() {

# Set Labels
docker_cli+=("--label" "io.hass.arch=${build_arch}")
docker_cli+=("--label" "io.hass.version=${version}")
docker_cli+=("--label" "org.opencontainers.image.version=${version}")
docker_cli+=("--label" "org.opencontainers.image.created=$(date --rfc-3339=seconds --utc)")
docker_cli+=("--label" "io.hass.version=${release}")
docker_cli+=("--label" "org.opencontainers.image.version=${release}")

# Validate the base image
codenotary_validate "${VCN_FROM}" "${build_from}" "true"
Expand Down Expand Up @@ -413,6 +415,7 @@ function build_base() {
# Set type
docker_cli+=("--label" "io.hass.type=base")
docker_cli+=("--label" "io.hass.base.version=${RELEASE}")
docker_cli+=("--label" "io.hass.base.arch=${build_arch}")
docker_cli+=("--label" "io.hass.base.image=${build_from}")

# Start build
Expand Down

0 comments on commit fda1b6e

Please sign in to comment.