forked from phillbaker/terraform-provider-elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
75 lines (75 loc) · 3.56 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
sudo: required # required for docker
language: go
go:
- '1.14'
git:
depth: false # we depend on full git history for linters
cache:
directories:
- $HOME/gopath/pkg/mod
env:
global:
# GITHUB_TOKEN
- secure: vSQRrg0xFXWfVJrqDA+QLy9xly2M55KhYFCLCotAyLYtf0nWjCcN5rsMcDT+Ik+fwcP24ykdw+4iBqorWxJqGedHtS7fmXcQqSr89lUMij/8ubZeV/mJ1bIpgGzf6FfLYFb1O7MP+D1eLzOFzc7rmAwY8JhRDVJd0j9DdP/pqFB7dAk8W5viIja51vFXENA8XZNinkyXXGkTCCPCRIScBlYLm45B2LSpTBB/WSJqjj+twcpjUJVA0fcfSMDHmcjivL5gJH2l2PZr8NyUme69PQ5BiDVKPuBo5x+naEFBkqpayHoojTYfpzXuWH+0rU2f+GjQJJkldwvmkmhRQ5eMPBjtJl7As3lGxHNs8KaxY5evbmDy2mJMKTMiHSeF4ZdyUra1wKbm1xpUJI1x/46GOAAhwkLRv6vtb9Rrm0Lb3AMIH13Qb4+XuGkEau+0XOkmx22Kz5uGTeCnoZ65hzzBkKLlrpoOc8J7vmM4TBUuN26ayVv6FWf46aRlHptwWJ9znxOjP2A7+rZGL5haQB2y1S97gwt//PRPHcaTwwjZWcVN++Je65Pc1GWxyf3zSMR540lPu1B/RM+x30GlWywQWE/Q18burnzT9KoIY6cPiwE/Ko0e4GHFagGSh5OdY1H3SctMq0dRi7SjuQQb/VmS0N6k0+M5pW8IcFQMzekis4M=
jobs:
- 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.9 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.10.0
- ES_VERSION=7.9.3 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:1.6.0
addons:
ssh_known_hosts: github.com
apt:
update: true
packages:
- docker-ce
services:
- docker
before_install:
- sudo sysctl -w vm.max_map_count=262144
- docker-compose pull
- docker-compose up -d
install:
- export ELASTICSEARCH_URL=http://127.0.0.1:9200
- export TF_LOG=INFO
- env GO111MODULE=on go mod vendor
# Install linters
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.27.0
before_script:
- export GO111MODULE=on
# Linters and checks
- golangci-lint run --new-from-rev=bf51aaa --verbose --timeout=10m
- ./script/test-mod-tidy
# ensure that ES has come up and is available
- wget -q --waitretry=1 --retry-connrefused --tries=60 --timeout 60 -O - $ELASTICSEARCH_URL
# Opendistro lazily initializes its indexes, warm it up here :|
# https://github.com/opendistro-for-elasticsearch/alerting/issues/60
- |
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"}}' http://admin:[email protected]:9220/_opendistro/_alerting/destinations
fi
script:
# run tests
- TF_ACC=1 go test ./... -v -cover
# check goreleaser config for deprecations
- curl -sfL https://git.io/goreleaser | sh -s -- check
jobs:
allow_failures:
- go: master
include:
- stage: deploy
script: skip
before_deploy:
# decrypt and import gpg signing key
- openssl aes-256-cbc -K $encrypted_d823238f3370_key -iv $encrypted_d823238f3370_iv -in ci/gpg.priv.enc -out ci/gpg.priv -d
- gpg --import ci/gpg.priv
- rm ci/gpg.priv
- export GPG_FINGERPRINT=82B6A957
deploy:
- provider: script
skip_cleanup: true
script: curl -sL https://git.io/goreleaser | bash
on:
tags: true
branch: master
go: '1.14'
condition: $TRAVIS_OS_NAME = linux