sudo: required
language: ruby
cache: bundler
sudo: false

before_install: 
  - gem install bundler
  - docker build -t gabriprat/hoshinplan .

after_success:
  - docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
  - export REPO=gabriprat/hoshinplan
  - export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi`
  - docker build -f Dockerfile -t $REPO:$COMMIT .
  - docker tag $REPO:$COMMIT $REPO:$TAG
  - docker tag $REPO:$COMMIT $REPO:travis-$TRAVIS_BUILD_NUMBER
  - docker push $REPO
addons:
  postgresql: "9.4"
  code_climate:
    repo_token: 5636a9b21787d77dd5012723
before_script:
  - psql -c 'create database travis_ci_test;' -U postgres
  - bundle exec rake db:test:prepare
services:
  - docker
  - redis
rvm:
  - 2.3.0

sudo: required
language: ruby
cache: bundler
sudo: false

before_install: 
  - gem install bundler

after_success:
  - docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
  - export REPO=gabriprat/hoshinplan
  - export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi`
  - docker build -f Dockerfile -t $REPO:$COMMIT .
  - docker tag $REPO:$COMMIT $REPO:$TAG
  - docker tag $REPO:$COMMIT $REPO:travis-$TRAVIS_BUILD_NUMBER
  - docker push $REPO
addons:
  postgresql: "9.4"
  code_climate:
    repo_token: 5636a9b21787d77dd5012723
before_script:
  - psql -c 'create database travis_ci_test;' -U postgres
  - bundle exec rake db:test:prepare
services:
  - docker
  - redis
rvm:
  - 2.3.0

Remove double docker build command
Remove double docker build command
