-
Notifications
You must be signed in to change notification settings - Fork 13
/
.travis.yml
61 lines (49 loc) · 1.69 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
language: go
go:
- 1.12.x
# set tag for helm chart
env:
global:
- HELM_URL=https://get.helm.sh/helm-v3.0.2-linux-amd64.tar.gz
- CHART_NAME="service-broker-proxy-k8s-${TRAVIS_TAG:-\"0.0.0\"}"
- CHART_TGZ_NAME="${CHART_NAME}.tgz"
- CHART_URL="https://github.com/Peripli/service-broker-proxy-k8s/releases/download/${TRAVIS_TAG:-\"0.0.0\"}/${CHART_TGZ_NAME}"
install:
- go get github.com/alecthomas/gometalinter
# - go get github.com/GoASTScanner/gas/cmd/gas/...
- go get golang.org/x/tools/cmd/cover
- go get github.com/mattn/goveralls
before_script:
- gometalinter --install --update
script:
# Execute static checks
- gometalinter --vendor ./...
# Execute tests and generate coverage for all the packages except fakes and tests
- make test
- goveralls -coverprofile profile.cov -service=travis-ci
# Execute security scan
# - gas ./...
before_deploy:
# Download and install helm
- wget ${HELM_URL} -O helm.tar.gz
- tar -xzf helm.tar.gz
- mv linux-amd64/helm $HOME/bin
- rm -rf helm.tar.gz linux-amd64
# Change default docker image tag in values.yaml
- "sed -i -e 's/tag: master/tag: '${TRAVIS_TAG:-master}'/g' ./charts/service-broker-proxy-k8s/values.yaml"
# Create helm-chart
- mkdir out
- helm package --app-version ${TRAVIS_TAG:-"master"} --version ${TRAVIS_TAG:-"0.0.0"} -d ./out charts/service-broker-proxy-k8s
- helm repo index ./out
- sed -i "s|${CHART_TGZ_NAME}|${CHART_URL}|g" ./out/index.yaml
- mv ./out/index.yaml ./out/${CHART_NAME}.yaml
deploy:
provider: releases
file_glob: true
file: out/*
skip_cleanup: true
api_key: $GITHUB_TOKEN
on:
tags: true
notifications:
slack: openservicebrokerapi:KQo2QAC6LXeEeXPOemOXja48