sudo: required

language: go
go:
- 1.8
services:
  - docker

before_deploy:
  - docker --version
  - pip install --user awscli
  - export PATH=$PATH:$HOME/.local/bin
  - eval $(aws ecr get-login --region ap-southeast-2) #needs AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY envvars

# trying to fix postgis bug which comes on the travis infrastructure that has sudo.
before_install:
 - export DEBIAN_FRONTEND=noninteractive;
   sudo -E apt-get -yq update &>> ~/apt-get-update.log;
   sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install postgresql-9.5-postgis-2.3
 - sudo apt-get install -y xsltproc
 
install: true

addons:
  postgresql: '9.5'

before_script:
- psql -U postgres -c "create extension postgis"
- ./etc/scripts/initdb.sh

script:
  - go test -v ./internal/...
  - 'if [ "TRAVIS_SECURE_ENV_VARS" = "true" ]; then bash ./all.sh; fi'

deploy:
   - provider: script
     skip_cleanup: true
     script: ./build-push.sh fdsn-s3-consumer fdsn-ws fdsn-holdings-consumer
     on: 
       branch: master 

sudo: required

language: go
go:
- 1.8
services:
  - docker

before_deploy:
  - docker --version
  - pip install --user awscli
  - export PATH=$PATH:$HOME/.local/bin
  - eval $(aws ecr get-login --region ap-southeast-2) #needs AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY envvars

# trying to fix postgis bug which comes on the travis infrastructure that has sudo.
before_install:
 - export DEBIAN_FRONTEND=noninteractive;
   sudo -E apt-get -yq update &>> ~/apt-get-update.log;
   sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install postgresql-9.5-postgis-2.3
 - sudo apt-get install -y xsltproc
 
install: true

addons:
  postgresql: '9.5'

before_script:
- psql -U postgres -c "create extension postgis"
- ./etc/scripts/initdb.sh

script:
  - make -C vendor/github.com/GeoNet/collect/cvendor/libmseed
  - make -C vendor/github.com/GeoNet/collect/cvendor/libslink
  - go test -v ./internal/...
  - 'if [ "TRAVIS_SECURE_ENV_VARS" = "true" ]; then bash ./all.sh; fi'

deploy:
   - provider: script
     skip_cleanup: true
     script: ./build-push.sh fdsn-s3-consumer fdsn-ws fdsn-holdings-consumer
     on: 
       branch: master 

Make C deps in Travis.
Make C deps in Travis.
