language: go

sudo: false

services:
    - docker
    - mysql

go:
    - 1.8.x
    - tip

env:
    global:
        DB_HOST=127.0.0.1
        DB_PORT=3306
        DB_USER=root
        DB_PASS=""
        DB_NAME=service

before_install:
    - mkdir -p $HOME/bin
    - curl -sL http://get.binhq.io/githubin | DEST=$HOME/bin bash
    - githubin get Masterminds/glide 0.12.3 -o $HOME/bin
    - make envcheck
    - curl -s https://raw.githubusercontent.com/sagikazarmark/traviscripts/072477228717d0d3eb671ae5b767e272d01dd838/scripts/migrate.sh | bash

install: make setup

before_script:
    - export VERSION=${TRAVIS_TAG:-$TRAVIS_BRANCH}
    - export DOCKER_IMAGE=deshboard/$(go list . | cut -d '/' -f 3)
    - mysql -e 'CREATE DATABASE service;'
    - make migrate

script:
    - make ARGS="-tags=integration" check
    - if [[ $TRAVIS_EVENT_TYPE = push ]]; then make IMAGE=$DOCKER_IMAGE VERSION=$VERSION docker; fi

deploy:
    provider: script
    skip_cleanup: true
    script: docker login -u $DOCKER_USER -p $DOCKER_PASS && docker push $DOCKER_IMAGE
    on:
        all_branches: true
        condition: $TRAVIS_GO_VERSION =~ ^1\.8(\.[0-9]+)?$

language: go

sudo: false

services:
    - docker
    - mysql

go:
    - 1.8.x
    - tip

env:
    global:
        DB_HOST=127.0.0.1
        DB_PORT=3306
        DB_USER=root
        DB_PASS=""
        DB_NAME=service

before_install:
    - mkdir -p $HOME/bin
    - curl -sL http://get.binhq.io/githubin | DEST=$HOME/bin bash
    - githubin get Masterminds/glide 0.12.3 -o $HOME/bin
    - make envcheck
    - githubin get mattes/migrate 3.0.0-rc2 -o $HOME/bin

install: make setup

before_script:
    - export VERSION=${TRAVIS_TAG:-$TRAVIS_BRANCH}
    - export DOCKER_IMAGE=deshboard/$(go list . | cut -d '/' -f 3)
    - mysql -e 'CREATE DATABASE service;'
    - make migrate

script:
    - make ARGS="-tags=integration" check
    - if [[ $TRAVIS_EVENT_TYPE = push ]]; then make IMAGE=$DOCKER_IMAGE VERSION=$VERSION docker; fi

deploy:
    provider: script
    skip_cleanup: true
    script: docker login -u $DOCKER_USER -p $DOCKER_PASS && docker push $DOCKER_IMAGE
    on:
        all_branches: true
        condition: $TRAVIS_GO_VERSION =~ ^1\.8(\.[0-9]+)?$

Use githubin to install migrate
Use githubin to install migrate
