Skip to content

Commit

Permalink
Add debian support (#24)
Browse files Browse the repository at this point in the history
* Add debian support

* Execute
  • Loading branch information
pvizeli authored Aug 9, 2019
1 parent 807cc7c commit ced9d88
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ Options:
Build our base raspbian images.
--base-ubuntu <VERSION>
Build our base ubuntu images.
--base-debian <VERSION>
Build our base debian images.
--supervisor <PYTHON_TAG>
Build a Hass.io supervisor image.
--hassio-cli <VERSION>
Expand Down Expand Up @@ -412,6 +414,32 @@ function build_base_ubuntu_image() {
}


function build_base_debian_image() {
local build_arch=$1

local build_from=""
local image="{arch}-base-debian"
local docker_cli=()
local docker_tags=()

# Select builder image
if [ "$build_arch" == "armhf" ]; then
bashio::log.error "$build_arch not supported for debian"
return 1
fi

# Set type
docker_cli+=("--label" "io.hass.type=base")
docker_cli+=("--label" "io.hass.base.version=$RELEASE")
docker_cli+=("--label" "io.hass.base.name=debian")
docker_cli+=("--label" "io.hass.base.image=$DOCKER_HUB/$image")

# Start build
run_build "$TARGET/$build_arch" "$DOCKER_HUB" "$image" "$VERSION" \
"$build_from" "$build_arch" docker_cli[@] docker_tags[@]
}


function build_base_raspbian_image() {
local build_arch=$1

Expand Down Expand Up @@ -830,6 +858,12 @@ while [[ $# -gt 0 ]]; do
VERSION=$2
shift
;;
--base-debian)
BUILD_TYPE="base-debian"
SELF_CACHE=true
VERSION=$2
shift
;;
--base-raspbian)
BUILD_TYPE="base-raspbian"
SELF_CACHE=true
Expand Down Expand Up @@ -932,6 +966,8 @@ if [ "${#BUILD_LIST[@]}" -ne 0 ]; then
(build_base_python_image "$arch") &
elif [ "$BUILD_TYPE" == "base-ubuntu" ]; then
(build_base_ubuntu_image "$arch") &
elif [ "$BUILD_TYPE" == "base-debian" ]; then
(build_base_debian_image "$arch") &
elif [ "$BUILD_TYPE" == "base-raspbian" ]; then
(build_base_raspbian_image "$arch") &
elif [ "$BUILD_TYPE" == "cli" ]; then
Expand Down

0 comments on commit ced9d88

Please sign in to comment.