2019-02-13 16:54:02 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# the Docker repository tag being built.
|
|
|
|
declare CACHE_TAG
|
|
|
|
echo "CACHE_TAG: ${CACHE_TAG}"
|
|
|
|
# the name and tag of the Docker repository being built. (This variable is a combination of DOCKER_REPO:CACHE_TAG.)
|
|
|
|
declare IMAGE_NAME
|
|
|
|
echo "IMAGE_NAME: ${IMAGE_NAME}"
|
|
|
|
# the architecture to build
|
|
|
|
declare BUILD_ARCH
|
|
|
|
echo "BUILD_ARCH: ${BUILD_ARCH}"
|
|
|
|
# whether this is a hassio build
|
|
|
|
declare IS_HASSIO
|
|
|
|
echo "IS_HASSIO: ${IS_HASSIO}"
|
2019-02-13 21:29:08 +01:00
|
|
|
echo "PWD: $PWD"
|
2019-02-13 16:54:02 +01:00
|
|
|
|
|
|
|
if [[ ${IS_HASSIO} = "YES" ]]; then
|
|
|
|
docker build \
|
|
|
|
--build-arg "BUILD_FROM=esphome/esphome-hassio-base-${BUILD_ARCH}:1.0.0" \
|
|
|
|
--build-arg "BUILD_VERSION=${CACHE_TAG}" \
|
2019-02-13 21:29:08 +01:00
|
|
|
-t "${IMAGE_NAME}" -f ../docker/Dockerfile.hassio .
|
2019-02-13 16:54:02 +01:00
|
|
|
else
|
|
|
|
docker build \
|
|
|
|
--build-arg "BUILD_FROM=esphome/esphome-base-${BUILD_ARCH}:1.0.0" \
|
2019-02-13 21:29:08 +01:00
|
|
|
-t "${IMAGE_NAME}" -f ../docker/Dockerfile .
|
2019-02-13 16:54:02 +01:00
|
|
|
fi
|