1
1
os : linux
2
- branches :
3
- except :
4
- - release-4.2
5
- - release-4.3
2
+ dist : xenial
3
+
4
+ # Install python3 and utilities dependencies
5
+ addons :
6
+ apt :
7
+ packages :
8
+ - " python3"
9
+ - " python3-pip"
6
10
7
11
language : go
12
+ go :
13
+ - 1.15.2
8
14
go_import_path : github.com/operator-framework/operator-sdk
9
15
10
- # go modules require xenial for mercurial TLS 1.2 support
11
- dist : xenial
12
-
13
16
# Python 3.6 is the default Python when language: python.
14
17
# But when not language: python, Python 3 can not be used by default.
15
18
# There is pip (/usr/bin/pip), but not pip3.
16
19
# Because of it the global env is required.
17
20
env :
18
21
global :
19
- - PATH=/opt/python/3.6.7/bin:$PATH
22
+ - PATH=/opt/python/3.6.7/bin:/tmp/operator-sdk/bin: $PATH
20
23
21
24
# Install python3 and utilities dependencies
22
25
addons :
@@ -27,20 +30,20 @@ addons:
27
30
28
31
cache :
29
32
directories :
30
- - $HOME/.cache/go-build
33
+ - $(go env GOCACHE)
34
+ - $(go env GOPATH)/pkg/mod
31
35
32
- go :
33
- - 1.15.x
36
+ branches :
37
+ except :
38
+ - release-4.2
39
+ - release-4.3
34
40
35
41
# The `x_base_steps` top-level key is unknown to travis,
36
42
# so we can use it to create a bunch of common build step
37
43
# YAML anchors which we use in our build jobs.
38
44
x_base_steps :
39
45
# Base go, ansbile, and helm job
40
46
- &test
41
- env :
42
- - CLUSTER=k8s
43
- # before_install for jobs that require go builds and do not run for doc-only changes
44
47
before_install :
45
48
# hack/ci/check-doc-only-update.sh needs to be sourced so
46
49
# that it can properly exit the test early with success
@@ -51,10 +54,7 @@ x_base_steps:
51
54
- make install
52
55
- make setup-k8s
53
56
- export KUBECONFIG="$(kind get kubeconfig-path --name="kind")"
54
- after_success :
55
- - echo "Tests passed"
56
57
after_failure :
57
- - echo "Tests failed"
58
58
- kubectl get all --all-namespaces
59
59
- kubectl get events --all-namespaces --field-selector=type=Warning
60
60
services :
@@ -66,10 +66,6 @@ x_base_steps:
66
66
- travis_retry make tidy
67
67
- git fetch origin --unshallow --tags
68
68
install : make install
69
- after_success :
70
- - echo "Image build succeeded, and docker image tagged and pushed to repository"
71
- after_failure :
72
- - echo "Image build, docker image tagging, or docker image pushing to repository failed"
73
69
services :
74
70
- docker
75
71
@@ -81,20 +77,18 @@ x_base_steps:
81
77
# We need /etc/docker to be accessible to non-root users.
82
78
# See https://github.com/moby/moby/pull/37847.
83
79
- sudo chmod 0755 /etc/docker
84
- after_success :
85
- - echo "Manifest list push to registry succeeded"
86
- after_failure :
87
- - echo "Manifest list creation or push to registry failed"
88
80
services :
89
81
- docker
90
82
91
83
stages :
92
84
- check
93
85
- test
94
86
- name : deploy
95
- if : type != pull_request AND ( tag IS present OR branch = master OR commit_message =~ /\[travis deploy\]/ )
87
+ if : type != pull_request AND ( tag IS present OR branch = master OR branch =~ /^v[0-9]+\.[0-9]+\.x$/ OR commit_message =~ /\[travis deploy\]/ )
96
88
- name : deploy-manifest-multiarch
97
- if : type != pull_request AND ( tag IS present OR branch = master OR commit_message =~ /\[travis deploy\]/ )
89
+ if : type != pull_request AND ( tag IS present OR branch = master OR branch =~ /^v[0-9]+\.[0-9]+\.x$/ OR commit_message =~ /\[travis deploy\]/ )
90
+ - name : release
91
+ if : type != pull_request AND tag IS present
98
92
99
93
jobs :
100
94
include :
@@ -103,23 +97,23 @@ jobs:
103
97
104
98
# Run the sanity tests
105
99
- stage : check
106
- name : Sanity Tests
100
+ name : sanity
107
101
before_install :
108
102
- git fetch origin --unshallow --tags
109
103
script :
110
104
- make test-sanity
111
105
112
106
# Run website checks
113
- - name : Doc Checks
107
+ - name : doc links
114
108
script :
115
109
- make test-links
116
110
117
111
# # Operator test stage jobs ##
118
112
119
113
# Build and test ansible and test ansible using molecule
120
114
- stage : test
115
+ name : ansible e2e
121
116
<< : *test
122
- name : Ansible on Kubernetes
123
117
before_script :
124
118
- pip3 install --upgrade setuptools pip
125
119
- pip install --user ansible~=2.9.13
@@ -128,15 +122,15 @@ jobs:
128
122
- make test-e2e-ansible-molecule
129
123
130
124
# Test subcommands
131
- - << : *test
132
- name : Subcommands and Integration on Kubernetes
125
+ - name : subcommand and integration
126
+ << : *test
133
127
script :
134
128
- make test-subcommand
135
129
- make test-integration
136
130
137
131
# Build and test go
138
- - << : *test
139
- name : Go on Kubernetes
132
+ - name : go unit and e2e
133
+ << : *test
140
134
before_script :
141
135
- (cd / && go get github.com/mattn/goveralls)
142
136
script :
@@ -146,48 +140,55 @@ jobs:
146
140
- $GOPATH/bin/goveralls -service=travis-ci -coverprofile=coverage.out -repotoken=$COVERALLS_TOKEN
147
141
148
142
# Build and test helm
149
- - << : *test
150
- name : Helm on Kubernetes
143
+ - name : helm e2e
144
+ << : *test
151
145
script : make test-e2e-helm
152
146
153
147
# # Image deploy/push stage jobs ##
154
148
155
149
# Build and deploy arm64 docker images
156
150
- stage : deploy
157
- << : *deploy
158
- name : Docker images for arm64
151
+ name : build and push images (arm64)
159
152
arch : arm64
153
+ << : *deploy
160
154
script :
161
- - make image-build-ansible image-build-helm image-build-scorecard-test image-build-scorecard-test-kuttl image-build-sdk
162
- - make image-push-ansible image-push-helm image-push-scorecard-test image-push-scorecard-test-kuttl image-push-sdk
155
+ - make -f images/Makefile image-build
156
+ - make -f images/Makefile image-push
163
157
164
158
# Build and deploy amd64 docker images
165
- - << : *deploy
166
- name : Docker images for amd64
159
+ - name : build and push images (amd64)
167
160
arch : amd64
161
+ << : *deploy
168
162
script :
169
- - make image-build-ansible image-build-helm image-build-scorecard-test image-build-scorecard-test-kuttl image-build-sdk
170
- - make image-push-ansible image-push-helm image-push-scorecard-test image-push-scorecard-test-kuttl image-push-sdk
163
+ - make -f images/Makefile image-build
164
+ - make -f images/Makefile image-push
171
165
172
166
# Build and deploy ppc64le docker images
173
- - << : *deploy
174
- name : Docker images for ppc64le
167
+ - name : build and push images (ppc64le)
175
168
arch : ppc64le
169
+ << : *deploy
176
170
script :
177
- - make image-build-ansible image-build-helm image-build-scorecard-test image-build-scorecard-test-kuttl image-build-sdk
178
- - make image-push-ansible image-push-helm image-push-scorecard-test image-push-scorecard-test-kuttl image-push-sdk
171
+ - make -f images/Makefile image-build
172
+ - make -f images/Makefile image-push
179
173
180
174
# Build and deploy s390x docker images
181
- - << : *deploy
182
- name : Docker images for s390x
175
+ - name : build and push images (s390x)
183
176
arch : s390x
177
+ << : *deploy
184
178
script :
185
- - make image-build-ansible image-build-helm image-build-scorecard-test image-build-sdk
186
- - make image-push-ansible image-push-helm image-push-scorecard-test image-push-sdk
179
+ # Use targets directly since
180
+ - make -f images/Makefile image/ansible-operator image/helm-operator image/operator-sdk image/scorecard-test
181
+ - make -f images/Makefile image-push/ansible-operator image-push/helm-operator image-push/operator-sdk image-push/scorecard-test
187
182
188
183
# Build and deploy ansible multi-arch manifest list
189
184
- stage : deploy-manifest-multiarch
185
+ name : push manifest lists
190
186
<< : *manifest-deploy
191
- name : Manifest lists
192
- script :
193
- - make image-push-ansible-multiarch image-push-helm-multiarch image-push-scorecard-test-multiarch image-push-scorecard-test-kuttl-multiarch image-push-sdk-multiarch
187
+ script : make -f images/Makefile image-push-multiarch
188
+
189
+ # # Release jobs ##
190
+
191
+ - stage : release
192
+ name : publish release
193
+ before_install : git fetch origin --unshallow --tags
194
+ script : make -f release/Makefile release TAG="$TRAVIS_TAG"
0 commit comments