forked from operator-framework/operator-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
153 lines (132 loc) · 4.23 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
os: linux
dist: xenial
language: go
go:
- 1.15.x
go_import_path: github.com/operator-framework/operator-sdk
cache:
directories:
- ${HOME}/.cache/go-build
- $(go env GOPATH)/pkg/mod
# The `x_base_steps` top-level key is unknown to travis,
# so we can use it to create a bunch of common build step
# YAML anchors which we use in our build jobs.
x_base_steps:
# Base go, ansbile, and helm job
- &test
before_install:
# hack/ci/check-doc-only-update.sh needs to be sourced so
# that it can properly exit the test early with success
- source hack/ci/check-doc-only-update.sh
- git fetch origin --unshallow --tags
after_failure:
- kubectl get all --all-namespaces
- kubectl get events --all-namespaces --field-selector=type=Warning
services:
- docker
# Base deploy job
- &deploy
before_install:
- git fetch origin --unshallow --tags
services:
- docker
# Manifest list deploy job
- &manifest-deploy
before_script:
- git fetch origin --unshallow --tags
# TODO: remove the chmod command when docker-ce on travis is upgraded to 18.09.0+.
# We need /etc/docker to be accessible to non-root users.
# See https://github.com/moby/moby/pull/37847.
- sudo chmod 0755 /etc/docker
services:
- docker
stages:
- check
- test
- name: deploy
if: type != pull_request AND ( tag IS present OR branch = master OR commit_message =~ /\[travis deploy\]/ )
- name: deploy-manifest-multiarch
if: type != pull_request AND ( tag IS present OR branch = master OR commit_message =~ /\[travis deploy\]/ )
jobs:
include:
## Project check stage jobs ##
# Run the sanity tests
- stage: check
name: sanity
before_install:
- git fetch origin --unshallow --tags
script:
- make test-sanity
# Run website checks
- name: doc links
script:
- make test-links
## Operator test stage jobs ##
# Build and test ansible and test ansible using molecule
- stage: test
name: ansible e2e
<<: *test
env:
# Required to set python3 as the default python interpreter.
- PATH=/opt/python/3.6.7/bin:${PATH}
before_script:
- sudo apt-get install python3 python3-pip
- pip3 install --upgrade setuptools pip
- pip install --user ansible~=2.9.13
script:
- make test-e2e-ansible test-e2e-ansible-molecule
# Test subcommands
- name: subcommand and integration
<<: *test
script:
- make test-e2e-integration
# Build and test go
- name: go unit and e2e
<<: *test
before_script:
- (cd / && go get github.com/mattn/goveralls)
script:
- make test-unit
- make test-e2e-go
after_success:
- $GOPATH/bin/goveralls -service=travis-ci -coverprofile=coverage.out -repotoken=$COVERALLS_TOKEN
# Build and test helm
- name: helm e2e
<<: *test
script: make test-e2e-helm
## Image deploy/push stage jobs ##
# Build and deploy arm64 docker images
- stage: deploy
name: build and push images
arch: arm64
<<: *deploy
script:
- make image-build
- make -f release/Makefile image-push
# Build and deploy amd64 docker images
- name: build and push images
arch: amd64
<<: *deploy
script:
- make image-build
- make -f release/Makefile image-push
# Build and deploy ppc64le docker images
- name: build and push images
arch: ppc64le
<<: *deploy
script:
- make image-build
- make -f release/Makefile image-push
# Build and deploy s390x docker images
- name: build and push images
arch: s390x
<<: *deploy
script:
# Use targets directly since kuttl doesn't support s390x.
- make image/ansible-operator image/helm-operator image/operator-sdk image/scorecard-test
- make -f release/Makefile image-push/ansible-operator image-push/helm-operator image-push/operator-sdk image-push/scorecard-test
# Build and deploy ansible multi-arch manifest list
- stage: deploy-manifest-multiarch
name: push manifest lists
<<: *manifest-deploy
script: make -f release/Makefile image-push-multiarch