From ced9d88a666ccf9649f1a64b935574ebcb18d1c7 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Fri, 9 Aug 2019 09:41:58 +0200 Subject: [PATCH] Add debian support (#24) * Add debian support * Execute --- builder.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/builder.sh b/builder.sh index d620407..6a0f4a5 100755 --- a/builder.sh +++ b/builder.sh @@ -128,6 +128,8 @@ Options: Build our base raspbian images. --base-ubuntu Build our base ubuntu images. + --base-debian + Build our base debian images. --supervisor Build a Hass.io supervisor image. --hassio-cli @@ -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 @@ -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 @@ -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