# make use of vm's sudo: 'required' # have the docker service set up (we'll # update it later) services: - docker # prepare the machine before any code # installation scripts before_install: - ./.travis/main.sh script: - make test - make docker-image # only execute the following instructions in # the case of a success (failing at this point # won't mark the build as a failure). # To have `DOCKER_USERNAME` and `DOCKER_PASSWORD` # filled you need to either use `travis`' cli # and then `travis set ..` or go to the travis # page of your repository and then change the # environment in the settings panel. after_success: - if [[ "$TRAVIS_BRANCH" == "master" ]]; then docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD ; make docker-push ; fi