sudo: required
services:
- docker
language: bash
script:
# prepare qemu
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
# build image
- docker build -t fdubuisson/knxd-build-rpi .
# test image
- docker run fdubuisson/knxd-build-rpi knxd --version
# push image
- >
  if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
    docker login -u="$DOCKER_USER" -p="$DOCKER_PASS"
    docker push fdubuisson/knxd-build-rpi
  fi

sudo: required
services:
- docker
language: bash
script:
# prepare qemu
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
# build image
- docker build -t fdubuisson/knxd-build-rpi .
# test image
- docker run fdubuisson/knxd-build-rpi knxd --version
# push image
- >
  if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
    docker login -u="$DOCKER_USER" -p="$DOCKER_PASS"
    TAG=$(docker run fdubuisson/knxd-build-rpi knxd --version | cut -d ' ' -f 2 | cut -d ':' -f 1)
    docker tag fdubuisson/knxd-build-rpi fdubuisson/knxd-build-rpi:$TAG
    docker push fdubuisson/knxd-build-rpi:$TAG
    docker push fdubuisson/knxd-build-rpi
  fi

Tag docker builds with knxd version
Tag docker builds with knxd version
