Skip to content
Draft
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
19 changes: 19 additions & 0 deletions builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ set +u

#### Variable ####

NAMESPACE=
DOCKER_TIMEOUT=20
DOCKER_PID=-1
DOCKER_HUB=
Expand Down Expand Up @@ -104,6 +105,8 @@ Options:
Use same tag as cache tag instead latest.
--cache-tag <TAG>
Use a custom tag for the build cache.
-n, --namespace <NAMESPACE>
Set or overwrite name of personal account or organization to build from.
-d, --docker-hub <DOCKER_REPOSITORY>
Set or overwrite the docker repository.
--docker-hub-check
Expand Down Expand Up @@ -440,6 +443,8 @@ function build_base() {
if ! bashio::var.has_value "${raw_image}"; then
bashio::log.error "Can't find the image tag on build.json"
return 1
elif bashio::var.has_value "${NAMESPACE}"; then
raw_image="${raw_image%%/*}/${NAMESPACE}/${raw_image##*/}"
fi
repository="${raw_image%/*}"
image="${raw_image##*/}"
Expand Down Expand Up @@ -545,6 +550,9 @@ function build_addon() {

# Read data from image
if [ -n "$raw_image" ]; then
if bashio::var.has_value "${NAMESPACE}"; then
raw_image="${raw_image%%/*}/${NAMESPACE}/${raw_image##*/}"
fi
repository="${raw_image%/*}"
image="${raw_image##*/}"
fi
Expand Down Expand Up @@ -598,6 +606,8 @@ function build_generic() {
if ! bashio::var.has_value "$raw_image"; then
bashio::log.error "Can't find the image tag on build.json"
return 1
elif bashio::var.has_value "${NAMESPACE}"; then
raw_image="${raw_image%%/*}/${NAMESPACE}/${raw_image##*/}"
fi
repository="${raw_image%/*}"
image="${raw_image##*/}"
Expand Down Expand Up @@ -660,6 +670,11 @@ function build_machine() {
docker_cli+=("--file" "${TARGET}/${build_machine}")
fi

if bashio::var.has_value "${raw_image}"; then
if bashio::var.has_value "${NAMESPACE}"; then
raw_image="${raw_image%%/*}/${NAMESPACE}/${raw_image##*/}"
fi
fi
repository="${raw_image%/*}"
image="${raw_image##*/}"

Expand Down Expand Up @@ -878,6 +893,10 @@ while [[ $# -gt 0 ]]; do
VERSION_FROM=$2
shift
;;
-n|--namespace)
NAMESPACE=$2
shift
;;
--docker-hub-check)
DOCKER_HUB_CHECK=true
;;
Expand Down