forked from mKeRix/room-assistant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-docker.sh
executable file
·38 lines (35 loc) · 1.26 KB
/
build-docker.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
set -e
if [ -n "$TRAVIS_TAG" ]; then
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin;
if [ "$HASSIO" = "true" ]; then
docker run --rm \
--privileged \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ~/.docker:/root/.docker \
-v "$TRAVIS_BUILD_DIR":/data \
homeassistant/amd64-builder:latest \
--$PLATFORM \
-t /data
else
if [ "$PLATFORM" != "amd64" ]; then
TAG_ADDON="-$PLATFORM"
fi
docker build -t mkerix/room-assistant:${TRAVIS_TAG}${TAG_ADDON} -t mkerix/room-assistant:latest${TAG_ADDON} -f $PLATFORM.Dockerfile .
docker push mkerix/room-assistant:${TRAVIS_TAG}${TAG_ADDON}
docker push mkerix/room-assistant:latest${TAG_ADDON}
fi
else
if [ "$HASSIO" = "true" ]; then
docker run --rm \
--privileged \
-v /var/run/docker.sock:/var/run/docker.sock \
-v "$TRAVIS_BUILD_DIR":/data \
homeassistant/amd64-builder \
--test \
--$PLATFORM \
-t /data
else
docker build -f $PLATFORM.Dockerfile .
fi
fi