Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Commit

Permalink
Updated build script to only push if the commit is
Browse files Browse the repository at this point in the history
 tagged. Otherwise it should just test the build.
  • Loading branch information
Nicolai Bjerre Pedersen committed Mar 8, 2018
1 parent cf9bda9 commit 4e22a33
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sudo: required
services:
- docker
script:
- "$TRAVIS_BUILD_DIR/distribute.sh"
- "$TRAVIS_BUILD_DIR/build.sh"
env:
global:
secure: I1qaPNCHzZ0rntK1/aMMSCI50zhIdHO+V2UPwimUHmlQ8YdW1dUnuictFFoGEbp2S7owub9U4cwm5LHp8VjtrnDxoDEBuzb50RMTQ8vNWE4SAILawe9TWKfHQKqgCgONQsv9O4Bh8moqwDD+PrqnoGvqEsRjiS6Icx8jk1zCvy7WDzpgnZIHIzytAudRTNwVb/nIJWGMfG29ekxqLgX1YXQ6XsZfQm+JSt8a8dGLdYoYQZRbrriznanYkeMrBanwkKQgbmA1MirIwfcprvnXad1aX8l6/uKomvehc1PbUH6DXUqq8lzuu42gF+J9W3aL4YtbWYtzOItq2Hi0nnj26EvUyn1yIGzfCXv4j3eNA6cqplPKePZ9dYREx0bEiQP412T6w1WviRrhB4THSeCmn6HCkb/k2quTX4vLT1lQWOv4CRe0Qp5kHExbe2kGREJONiUsXU/6zKtT4S+iF9g5EalCaG8beFIwYllkbcSIsle/mfjHKTvwwQ8vI0cnRb7aKLI1pLgb6fQVIRN5ia+fwOvd/S/phy30wAzqtAjuxehbJ8dmnaS0Q21CRUmMAsRJ09x4KUTRMg0hBVib7JJ6jPQIvGgyILe4aJtBFZ5upxwPtk3eEc29RV/FbgJzPa7419boPflIpPY20a+VkfUpSjD4UcS/Xvd+6bjOecT9Fh4=
31 changes: 31 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
set -ev
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"

if [ -z ${TRAVIS_TAG} ]; then
echo "Untagged build found. Building to test."
docker run -it --rm --privileged --name "${ADDON_NAME}" \
-v ~/.docker:/root/.docker \
-v "$(pwd)":/docker \
hassioaddons/build-env:latest \
--target "${ADDON_NAME}" \
--git \
--all \
--from "homeassistant/{arch}-base" \
--author "Nicolai Bjerre Pedersen <[email protected]>" \
--doc-url "${GITHUB_URL}" \
--image "fixated/${ADDON_NAME}-{arch}"
else
echo "New git tagged build found. Building to distribute."
docker run -it --rm --privileged --name "${ADDON_NAME}" \
-v ~/.docker:/root/.docker \
-v "$(pwd)":/docker \
hassioaddons/build-env:latest \
--target "${ADDON_NAME}" \
--git \
--all \
--push \
--from "homeassistant/{arch}-base" \
--author "Nicolai Bjerre Pedersen <[email protected]>" \
--doc-url "${GITHUB_URL}" \
--image "fixated/${ADDON_NAME}-{arch}"
fi
13 changes: 0 additions & 13 deletions distribute.sh

This file was deleted.

0 comments on commit 4e22a33

Please sign in to comment.