sudo: required

language: node_js
node_js:
  - "6"

services:
  - docker

script:
  - docker build -t theconnman/missd .

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

sudo: required

language: node_js
node_js:
  - "6"

services:
  - docker

script:
  - docker build -t theconnman/missd .

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

Rebuild dev builds to pick up version change
Rebuild dev builds to pick up version change
