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