Skip to content

Commit f4e8d6f

Browse files
committed
*: move make targets around such that release-related targets are in
their own Makefile, ex. image builds are in release/Makefile images/: move all Dockerfiles from hack/image to here, update references hack/: remove unnecessary wrapper scripts
1 parent e311086 commit f4e8d6f

File tree

36 files changed

+280
-352
lines changed

36 files changed

+280
-352
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ website/tech-doc-hugo
1515
# samples bin
1616
testdata/go/memcached-operator/bin/*
1717

18-
18+
# Trash files
1919
*\.DS_Store
2020

2121
# Created by https://www.toptal.com/developers/gitignore/api/go,vim,emacs,visualstudiocode

.travis.yml

Lines changed: 41 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
os: linux
2-
language: go
3-
go_import_path: github.com/operator-framework/operator-sdk
42
dist: xenial
53

4+
# Install python3 and utilities dependencies
5+
addons:
6+
apt:
7+
packages:
8+
- "python3"
9+
- "python3-pip"
10+
611
# Python 3.6 is the default Python when language: python.
712
# But when not language: python, Python 3 can not be used by default.
813
# There is pip (/usr/bin/pip), but not pip3.
@@ -11,37 +16,28 @@ env:
1116
global:
1217
- PATH=/opt/python/3.6.7/bin:$PATH
1318

14-
# Install python3 and utilities dependencies
15-
addons:
16-
apt:
17-
packages:
18-
- "python3"
19-
- "python3-pip"
19+
language: go
20+
go:
21+
- 1.15.x
22+
go_import_path: github.com/operator-framework/operator-sdk
2023

2124
cache:
2225
directories:
23-
- $HOME/.cache/go-build
24-
25-
go:
26-
- 1.15.x
26+
- ${HOME}/.cache/go-build
27+
- $(go env GOPATH)/pkg/mod
2728

2829
# The `x_base_steps` top-level key is unknown to travis,
2930
# so we can use it to create a bunch of common build step
3031
# YAML anchors which we use in our build jobs.
3132
x_base_steps:
3233
# Base go, ansbile, and helm job
3334
- &test
34-
env:
35-
# before_install for jobs that require go builds and do not run for doc-only changes
3635
before_install:
3736
# hack/ci/check-doc-only-update.sh needs to be sourced so
3837
# that it can properly exit the test early with success
3938
- source hack/ci/check-doc-only-update.sh
4039
- git fetch origin --unshallow --tags
41-
after_success:
42-
- echo "Tests passed"
4340
after_failure:
44-
- echo "Tests failed"
4541
- kubectl get all --all-namespaces
4642
- kubectl get events --all-namespaces --field-selector=type=Warning
4743
services:
@@ -51,10 +47,6 @@ x_base_steps:
5147
- &deploy
5248
before_install:
5349
- 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"
5850
services:
5951
- docker
6052

@@ -66,10 +58,6 @@ x_base_steps:
6658
# We need /etc/docker to be accessible to non-root users.
6759
# See https://github.com/moby/moby/pull/37847.
6860
- 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"
7361
services:
7462
- docker
7563

@@ -88,38 +76,38 @@ jobs:
8876

8977
# Run the sanity tests
9078
- stage: check
91-
name: Sanity Tests
79+
name: sanity
9280
before_install:
9381
- git fetch origin --unshallow --tags
9482
script:
9583
- make test-sanity
9684

9785
# Run website checks
98-
- name: Doc Checks
86+
- name: doc links
9987
script:
10088
- make test-links
10189

10290
## Operator test stage jobs ##
10391

10492
# Build and test ansible and test ansible using molecule
10593
- stage: test
94+
name: ansible e2e
10695
<<: *test
107-
name: Ansible on Kubernetes
10896
before_script:
10997
- pip3 install --upgrade setuptools pip
11098
- pip install --user ansible~=2.9.13
11199
script:
112100
- make test-e2e-ansible test-e2e-ansible-molecule
113101

114102
# Test subcommands
115-
- <<: *test
116-
name: Subcommands and Integration on Kubernetes
103+
- name: subcommand and integration
104+
<<: *test
117105
script:
118106
- make test-e2e-integration
119107

120108
# Build and test go
121-
- <<: *test
122-
name: Go on Kubernetes
109+
- name: go unit and e2e
110+
<<: *test
123111
before_script:
124112
- (cd / && go get github.com/mattn/goveralls)
125113
script:
@@ -129,48 +117,48 @@ jobs:
129117
- $GOPATH/bin/goveralls -service=travis-ci -coverprofile=coverage.out -repotoken=$COVERALLS_TOKEN
130118

131119
# Build and test helm
132-
- <<: *test
133-
name: Helm on Kubernetes
120+
- name: helm e2e
121+
<<: *test
134122
script: make test-e2e-helm
135123

136124
## Image deploy/push stage jobs ##
137125

138126
# Build and deploy arm64 docker images
139127
- stage: deploy
140-
<<: *deploy
141-
name: Docker images for arm64
128+
name: build and push images
142129
arch: arm64
130+
<<: *deploy
143131
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
132+
- make image-build
133+
- make -f release/Makefile image-push
146134

147135
# Build and deploy amd64 docker images
148-
- <<: *deploy
149-
name: Docker images for amd64
136+
- name: build and push images
150137
arch: amd64
138+
<<: *deploy
151139
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
140+
- make image-build
141+
- make -f release/Makefile image-push
154142

155143
# Build and deploy ppc64le docker images
156-
- <<: *deploy
157-
name: Docker images for ppc64le
144+
- name: build and push images
158145
arch: ppc64le
146+
<<: *deploy
159147
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
148+
- make image-build
149+
- make -f release/Makefile image-push
162150

163151
# Build and deploy s390x docker images
164-
- <<: *deploy
165-
name: Docker images for s390x
152+
- name: build and push images
166153
arch: s390x
154+
<<: *deploy
167155
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
156+
# Use targets directly since kuttl doesn't support s390x.
157+
- make image/ansible-operator image/helm-operator image/operator-sdk image/scorecard-test
158+
- make -f release/Makefile image-push/ansible-operator image-push/helm-operator image-push/operator-sdk image-push/scorecard-test
170159

171160
# Build and deploy ansible multi-arch manifest list
172161
- stage: deploy-manifest-multiarch
162+
name: push manifest lists
173163
<<: *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
164+
script: make -f release/Makefile image-push-multiarch

0 commit comments

Comments
 (0)