Skip to content

Commit

Permalink
Cache go dependencies on travis, retry longer.
Browse files Browse the repository at this point in the history
  • Loading branch information
phillbaker committed Aug 14, 2019
1 parent f10a7a0 commit 2a2d563
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ language: go
go:
- '1.12'
- master
cache:
directories:
- $HOME/gopath/pkg/mod
env:
- ES_VERSION=5.6.16 ES_OSS_IMAGE=elasticsearch:${ES_VERSION} ES_IMAGE=docker.elastic.co/elasticsearch/elasticsearch:${ES_VERSION} ES_COMMAND="elasticsearch -Epath.repo=/tmp"
- ES_VERSION=6.8.0 ES_OSS_IMAGE=docker.elastic.co/elasticsearch/elasticsearch-oss:${ES_VERSION} ES_IMAGE=docker.elastic.co/elasticsearch/elasticsearch:${ES_VERSION} ES_OPENDISTRO_IMAGE=amazon/opendistro-for-elasticsearch:0.9.0
Expand All @@ -28,11 +31,14 @@ install:
- env GO111MODULE=on go mod vendor
script:
- export GO111MODULE=on
- wget -q --waitretry=1 --retry-connrefused -T 10 -O - $ELASTICSEARCH_URL
- wget -q --waitretry=1 --retry-connrefused --tries=60 --timeout 60 -O - $ELASTICSEARCH_URL
# Opendistro lazily initializes it's indexes, warm it up here :|
# https://github.com/opendistro-for-elasticsearch/alerting/issues/60
- |
if [ -n "$ES_OPENDISTRO_IMAGE" ]; then curl -X POST -H 'Content-type: application/json' -d '{"name":"_warmup","type":"slack","slack":{"url": "http://www.example.com"}}' 127.0.0.1:9220/_opendistro/_alerting/destinations; fi
if [ -n "$ES_OPENDISTRO_IMAGE" ]; then
wget -q --waitretry=1 --retry-connrefused --tries=60 --timeout 60 -O - 127.0.0.1:9220
curl -X POST -H 'Content-type: application/json' -d '{"name":"_warmup","type":"slack","slack":{"url": "http://www.example.com"}}' 127.0.0.1:9220/_opendistro/_alerting/destinations
fi
- TF_ACC=1 go test -v -cover
before_deploy:
- export GO111MODULE=on
Expand Down

0 comments on commit 2a2d563

Please sign in to comment.