forked from keikoproj/addon-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
61 lines (48 loc) · 1.5 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.14.x
git:
depth: 1
services:
- docker
env:
global:
- GO111MODULE=on
- KUBECONFIG=$HOME/.kube/config
- IMG=keikoproj/addon-manager:latest
cache:
directories:
- $HOME/.local
- $HOME/.kube
before_install:
# install dependencies needed by jobs
- wget https://github.com/kubernetes-sigs/kubebuilder/releases/download/v2.3.1/kubebuilder_2.3.1_linux_amd64.tar.gz
- tar -zxvf kubebuilder_2.3.1_linux_amd64.tar.gz
- sudo mv kubebuilder_2.3.1_linux_amd64 /usr/local/kubebuilder
install: skip
stages:
- unit-test
- build
- name: snapshot-release
if: NOT (type = pull_request) AND (tag IS NOT present) AND (branch = master)
- name: release
if: NOT (type = pull_request) AND (tag IS present) AND (branch = master)
jobs:
include:
- stage: unit-test
script:
- go test ./api/... ./controllers/... ./pkg/... ./cmd/... -coverprofile coverage.txt
- bash <(curl -s https://codecov.io/bash)
- stage: build
script:
- make docker-build
- stage: snapshot-release
script:
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
- export IMG=keikoproj/addon-manager
- curl -sL https://git.io/goreleaser | bash -s release --rm-dist --snapshot
- docker push ${IMG}:latest
- stage: release
script:
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
- curl -sL https://git.io/goreleaser | bash -s release --rm-dist