Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean version_tag function #123

Merged
merged 1 commit into from
Nov 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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