Skip to content

Commit

Permalink
Merge pull request #74 from danimtb/fix/ci_docker_login
Browse files Browse the repository at this point in the history
Fix CI with docker login and builds for all architectures
  • Loading branch information
danimtb authored Apr 14, 2019
2 parents c0a377f + 56245e8 commit 6270896
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 21 deletions.
18 changes: 18 additions & 0 deletions .ci/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#! /usr/bin/env python
import os


def run(cmd, message=None):
msg = message or cmd
print("\n%s\n" % msg)
ret = os.system(cmd)
if ret != 0:
raise Exception("Error running: %s" % msg)

travis_tag = os.getenv("TRAVIS_TAG")
addon = os.getenv("ADDON")

docker_build = "docker run --rm --privileged -v ~/.docker:/root/.docker -v $(pwd)/{addon}:/data homeassistant/amd64-builder --all -t /data --no-cache"
if not travis_tag:
docker_build = docker_build + " --test"
run(docker_build.format(addon=addon))
12 changes: 8 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
linux: &linux
os: linux
dist: xenial
language: python
python: "3.7"

sudo: required
services:
- docker
before_install:
- sudo apt-get install jq
env:
- ADDON="dasshio"
script:
- docker login -u $DOCKER_USER -p $DOCKER_PASS
- .travis/build.sh $ADDON
- docker login -u ${DOCKER_USER} -p ${DOCKER_PASS}
- python .ci/build.py
16 changes: 0 additions & 16 deletions .travis/build.sh

This file was deleted.

5 changes: 4 additions & 1 deletion dasshio/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
"startup": "services",
"arch": [
"amd64",
"armhf"
"armhf",
"i386",
"armv7",
"aarch64"
],
"boot": "auto",
"host_network": true,
Expand Down

0 comments on commit 6270896

Please sign in to comment.