sudo: required

language: node_js

services:
  - docker

script:
  - docker build -t theconnman/jukebot .

after_success:
  - docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
    if [ "$TRAVIS_BRANCH" == "master" ]; then
      VERSION=`node -e "console.log(require('./package.json').version);"`;
      docker tag theconnman/jukebot theconnman/jukebot:$VERSION;
      docker push theconnman/jukebot:latest;
      docker push theconnman/jukebot:$VERSION;
    elif [ "$TRAVIS_BRANCH" == "dev" ]; then
      docker push theconnman/jukebot:latest-dev;
    fi

sudo: required

language: node_js

services:
  - docker

script:
  - docker build -t theconnman/jukebot .

after_success:
  - docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
    if [ "$TRAVIS_BRANCH" == "master" ]; then
      VERSION=`node -e "console.log(require('./package.json').version);"`;
      docker tag theconnman/jukebot theconnman/jukebot:$VERSION;
      docker push theconnman/jukebot:latest;
      docker push theconnman/jukebot:$VERSION;
    elif [ "$TRAVIS_BRANCH" == "dev" ]; then
      docker tag theconnman/jukebot theconnman/jukebot:latest-dev;
      docker push theconnman/jukebot:latest-dev;
    fi

Tag dev Docker image before pushing
Tag dev Docker image before pushing
