Skip to content

Commit

Permalink
Clean version_tag function (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
pvizeli authored Nov 25, 2021
1 parent cae7734 commit efd0039
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ function build_base() {
local repository=
local shadow_repository=
local raw_image=
local version_tag=false
local args=
local codenotary_base=
local codenotary_sign=
Expand All @@ -381,7 +380,6 @@ function build_base() {
args="$(jq --raw-output '.args // empty | keys[]' "/tmp/build_config/build.json")"
labels="$(jq --raw-output '.labels // empty | keys[]' "/tmp/build_config/build.json")"
raw_image="$(jq --raw-output '.image // empty' "/tmp/build_config/build.json")"
version_tag="$(jq --raw-output '.version_tag // false' "/tmp/build_config/build.json")"
shadow_repository="$(jq --raw-output '.shadow_repository // empty' "/tmp/build_config/build.json")"
codenotary_base="$(jq --raw-output '.codenotary.base_image // empty' "/tmp/build_config/build.json")"
codenotary_sign="$(jq --raw-output '.codenotary.signer // empty' "/tmp/build_config/build.json")"
Expand Down Expand Up @@ -535,7 +533,6 @@ function build_generic() {
local repository=
local shadow_repository=
local raw_image=
local version_tag=false
local args=
local codenotary_base=
local codenotary_sign=
Expand All @@ -548,7 +545,6 @@ function build_generic() {
args="$(jq --raw-output '.args // empty | keys[]' "/tmp/build_config/build.json")"
labels="$(jq --raw-output '.labels // empty | keys[]' "/tmp/build_config/build.json")"
raw_image="$(jq --raw-output '.image // empty' "/tmp/build_config/build.json")"
version_tag="$(jq --raw-output '.version_tag // false' "/tmp/build_config/build.json")"
shadow_repository="$(jq --raw-output '.shadow_repository // empty' "/tmp/build_config/build.json")"
codenotary_base="$(jq --raw-output '.codenotary.base_image // empty' "/tmp/build_config/build.json")"
codenotary_sign="$(jq --raw-output '.codenotary.signer // empty' "/tmp/build_config/build.json")"
Expand Down Expand Up @@ -584,17 +580,6 @@ function build_generic() {
done
fi

# Version Tag
if bashio::var.true "$version_tag"; then
if [[ "$VERSION" =~ d ]]; then
docker_tags+=("dev")
elif [[ "$VERSION" =~ b ]]; then
docker_tags+=("beta")
else
docker_tags+=("stable")
fi
fi

# Start build
run_build "$TARGET" "$repository" "$image" "$VERSION" \
"$build_from" "$build_arch" docker_cli[@] docker_tags[@] "${shadow_repository}" \
Expand All @@ -612,7 +597,6 @@ function build_machine() {
local raw_image=
local build_from=
local shadow_repository=
local version_tag=false
local codenotary_base=
local codenotary_sign=
local docker_cli=()
Expand All @@ -624,7 +608,6 @@ function build_machine() {
args="$(jq --raw-output '.args // empty | keys[]' "/tmp/build_config/build.json")"
labels="$(jq --raw-output '.labels // empty | keys[]' "/tmp/build_config/build.json")"
raw_image="$(jq --raw-output '.image // empty' "/tmp/build_config/build.json")"
version_tag="$(jq --raw-output '.version_tag // false' "/tmp/build_config/build.json")"
shadow_repository="$(jq --raw-output '.shadow_repository // empty' "/tmp/build_config/build.json")"
codenotary_base="$(jq --raw-output '.codenotary.base_image // empty' "/tmp/build_config/build.json")"
codenotary_sign="$(jq --raw-output '.codenotary.signer // empty' "/tmp/build_config/build.json")"
Expand Down Expand Up @@ -667,17 +650,6 @@ function build_machine() {
# Set labels
docker_cli+=("--label" "io.hass.machine=${build_machine}")

# Version Tag
if bashio::var.true "${version_tag}"; then
if [[ "${VERSION}" =~ d ]]; then
docker_tags+=("dev")
elif [[ "${VERSION}" =~ b ]]; then
docker_tags+=("beta")
else
docker_tags+=("stable")
fi
fi

# Start build
run_build "${TARGET}" "${repository}" "${image}" "${VERSION}" \
"${build_from}" "${build_arch}" docker_cli[@] docker_tags[@] "${shadow_repository}" \
Expand Down

0 comments on commit efd0039

Please sign in to comment.