os:
  - linux

language: go

dist: trusty
group: deprecated-2017Q4

go:
  - 1.9

before_install:
  - sudo apt-get -qq update
  - sudo apt-get install -y build-essential rpm
  - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
  - gem install fpm

script:
  - go test github.com/honeycombio/rdslogs/... -bench=.
  - go vet ./...

after_success:
  - rm $GOPATH/bin/rdslogs
  - go install -ldflags "-X main.BuildID=1.${TRAVIS_BUILD_NUMBER}" github.com/honeycombio/rdslogs/...
  - $GOPATH/bin/rdslogs --write_default_config > ./rdslogs.conf
  - ./build-pkg.sh -v "1.${TRAVIS_BUILD_NUMBER}" -t deb
  - ./build-pkg.sh -v "1.${TRAVIS_BUILD_NUMBER}" -t rpm
  - docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
  - docker build -t "honeycombio/rdslogs:1.${TRAVIS_BUILD_NUMBER}" .
  - docker push "honeycombio/rdslogs:1.${TRAVIS_BUILD_NUMBER}"


addons:
    artifacts:
        debug: true
        paths:
        - $GOPATH/bin

os:
  - linux

language: go

dist: trusty
group: deprecated-2017Q4

go:
  - 1.9

before_install:
  - sudo apt-get -qq update
  - sudo apt-get install -y build-essential rpm
  - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
  - gem install fpm

script:
  - go test github.com/honeycombio/rdslogs/... -bench=.
  - go vet ./...

after_success:
  - rm $GOPATH/bin/rdslogs
  - go install -ldflags "-X main.BuildID=1.${TRAVIS_BUILD_NUMBER}" github.com/honeycombio/rdslogs/...
  - $GOPATH/bin/rdslogs --write_default_config > ./rdslogs.conf
  - ./build-pkg.sh -v "1.${TRAVIS_BUILD_NUMBER}" -t deb
  - ./build-pkg.sh -v "1.${TRAVIS_BUILD_NUMBER}" -t rpm
  - docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
  - docker build -t "honeycombio/rdslogs:1.${TRAVIS_BUILD_NUMBER}" .
  - docker tag "honeycombio/rdslogs:1.${TRAVIS_BUILD_NUMBER}" honeycomb.io/rdslogs:latest
  - docker push honeycombio/rdslogs


addons:
    artifacts:
        debug: true
        paths:
        - $GOPATH/bin

Tag newly built docker image with latest too
Tag newly built docker image with latest too

By adding and pushing a latest tag, users will be able to just pull the
container from docker hub without having to pin to a specific version.
