This repository has been archived by the owner on Apr 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy path.travis.yml
64 lines (60 loc) · 2.24 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
---
# yamllint disable rule:line-length
sudo: true
addons:
apt:
packages:
- docker-ce
- python
- realpath
- ruby
env:
global:
- GO_METALINTER_VERSION="v3.0.0"
- OPERATOR_SDK_URL="https://github.com/operator-framework/operator-sdk/releases/download/v0.3.0/operator-sdk-v0.3.0-x86_64-linux-gnu"
- CONTAINER_REPO="gluster/anthill"
jobs:
include:
- name: Linters
install:
- travis_retry gem install asciidoctor mdl
- travis_retry pip install --user mkdocs yamllint
script:
- scripts/pre-commit.sh --require-all
- mkdocs build
- name: Build
language: go
go: "1.10.x"
go_import_path: "github.com/gluster/anthill"
install:
- travis_retry curl -L https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
# install gometalinter
- travis_retry curl -L 'https://raw.githubusercontent.com/alecthomas/gometalinter/master/scripts/install.sh' | bash -s -- -b ${TRAVIS_HOME}/gopath/bin "${GO_METALINTER_VERSION}"
# install operator-sdk
- >
travis_retry sudo curl -L -o /usr/local/bin/operator-sdk "${OPERATOR_SDK_URL}"
&& sudo chmod a+x /usr/local/bin/operator-sdk
script:
- travis_retry dep ensure -v --vendor-only
- dep check
- >
set -o pipefail &&
gometalinter -j4
--sort path --sort line --sort column
--deadline=24h --enable="gofmt" --vendor --debug
--exclude="zz_generated.deepcopy.go" ./...
|& stdbuf -oL awk '/linter took/ || !/^DEBUG/ || /nolint:/'
- ./build.sh "${CONTAINER_REPO}"
deploy:
# Master branch will push the container to :latest
- provider: script
on: # yamllint disable-line rule:truthy
branch: master
script: .travis/push_container.sh ${CONTAINER_REPO} verbatim latest
# Tags of the form v + SEMVER (e.g., v1.2.3) will push to the
# corresponding container version number (e.g., :1.2.3).
- provider: script
on: # yamllint disable-line rule:truthy
tags: true
condition: $TRAVIS_TAG =~ ^v[0-9]+
script: .travis/push_container.sh ${CONTAINER_REPO} version "$TRAVIS_TAG"