# Use the new Container based KVM stack which allows "sudo" access
dist: trusty

sudo: required

language: go

only:
  - master

go:
  - 1.6

services:
    - docker

install:
  - true

script:
  - go test -cpu=2 -race -v -covermode=atomic ./...

# Run rolling update
after_success:
  - CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o plex-elastic-transcoder github.com/munnerz/plex-elastic-transcoder
  - docker build -t munnerz/elastic-plex:${TRAVIS_COMMIT:0:7} -f Dockerfile.plex .
  - docker tag -f munnerz/elastic-plex:${TRAVIS_COMMIT:0:7} "munnerz/elastic-plex:latest"
  - docker push munnerz/elastic-plex:latest
  - docker push munnerz/elastic-plex:${TRAVIS_COMMIT:0:7}
