Skip to content

Commit 09c3aa1

Browse files
author
Eric Stroczynski
authored
*: refactor Dockerfiles and Makefiles (#4069)
1 parent 5776ba2 commit 09c3aa1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+297
-484
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: 38 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,28 @@
11
os: linux
2-
language: go
3-
go_import_path: github.com/operator-framework/operator-sdk
42
dist: xenial
53

6-
# Python 3.6 is the default Python when language: python.
7-
# But when not language: python, Python 3 can not be used by default.
8-
# There is pip (/usr/bin/pip), but not pip3.
9-
# Because of it the global env is required.
10-
env:
11-
global:
12-
- PATH=/opt/python/3.6.7/bin:$PATH
13-
14-
# Install python3 and utilities dependencies
15-
addons:
16-
apt:
17-
packages:
18-
- "python3"
19-
- "python3-pip"
4+
language: go
5+
go:
6+
- 1.15.x
7+
go_import_path: github.com/operator-framework/operator-sdk
208

219
cache:
2210
directories:
23-
- $HOME/.cache/go-build
24-
25-
go:
26-
- 1.15.x
11+
- ${HOME}/.cache/go-build
12+
- $(go env GOPATH)/pkg/mod
2713

2814
# The `x_base_steps` top-level key is unknown to travis,
2915
# so we can use it to create a bunch of common build step
3016
# YAML anchors which we use in our build jobs.
3117
x_base_steps:
3218
# Base go, ansbile, and helm job
3319
- &test
34-
env:
35-
# before_install for jobs that require go builds and do not run for doc-only changes
3620
before_install:
3721
# hack/ci/check-doc-only-update.sh needs to be sourced so
3822
# that it can properly exit the test early with success
3923
- source hack/ci/check-doc-only-update.sh
4024
- git fetch origin --unshallow --tags
41-
after_success:
42-
- echo "Tests passed"
4325
after_failure:
44-
- echo "Tests failed"
4526
- kubectl get all --all-namespaces
4627
- kubectl get events --all-namespaces --field-selector=type=Warning
4728
services:
@@ -51,10 +32,6 @@ x_base_steps:
5132
- &deploy
5233
before_install:
5334
- 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"
5835
services:
5936
- docker
6037

@@ -66,10 +43,6 @@ x_base_steps:
6643
# We need /etc/docker to be accessible to non-root users.
6744
# See https://github.com/moby/moby/pull/37847.
6845
- 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"
7346
services:
7447
- docker
7548

@@ -88,38 +61,42 @@ jobs:
8861

8962
# Run the sanity tests
9063
- stage: check
91-
name: Sanity Tests
64+
name: sanity
9265
before_install:
9366
- git fetch origin --unshallow --tags
9467
script:
9568
- make test-sanity
9669

9770
# Run website checks
98-
- name: Doc Checks
71+
- name: doc links
9972
script:
10073
- make test-links
10174

10275
## Operator test stage jobs ##
10376

10477
# Build and test ansible and test ansible using molecule
10578
- stage: test
79+
name: ansible e2e
10680
<<: *test
107-
name: Ansible on Kubernetes
81+
env:
82+
# Required to set python3 as the default python interpreter.
83+
- PATH=/opt/python/3.6.7/bin:${PATH}
10884
before_script:
85+
- sudo apt-get install python3 python3-pip
10986
- pip3 install --upgrade setuptools pip
11087
- pip install --user ansible~=2.9.13
11188
script:
11289
- make test-e2e-ansible test-e2e-ansible-molecule
11390

11491
# Test subcommands
115-
- <<: *test
116-
name: Subcommands and Integration on Kubernetes
92+
- name: subcommand and integration
93+
<<: *test
11794
script:
11895
- make test-e2e-integration
11996

12097
# Build and test go
121-
- <<: *test
122-
name: Go on Kubernetes
98+
- name: go unit and e2e
99+
<<: *test
123100
before_script:
124101
- (cd / && go get github.com/mattn/goveralls)
125102
script:
@@ -129,48 +106,48 @@ jobs:
129106
- $GOPATH/bin/goveralls -service=travis-ci -coverprofile=coverage.out -repotoken=$COVERALLS_TOKEN
130107

131108
# Build and test helm
132-
- <<: *test
133-
name: Helm on Kubernetes
109+
- name: helm e2e
110+
<<: *test
134111
script: make test-e2e-helm
135112

136113
## Image deploy/push stage jobs ##
137114

138115
# Build and deploy arm64 docker images
139116
- stage: deploy
140-
<<: *deploy
141-
name: Docker images for arm64
117+
name: build and push images
142118
arch: arm64
119+
<<: *deploy
143120
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
121+
- make image-build
122+
- make -f release/Makefile image-push
146123

147124
# Build and deploy amd64 docker images
148-
- <<: *deploy
149-
name: Docker images for amd64
125+
- name: build and push images
150126
arch: amd64
127+
<<: *deploy
151128
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
129+
- make image-build
130+
- make -f release/Makefile image-push
154131

155132
# Build and deploy ppc64le docker images
156-
- <<: *deploy
157-
name: Docker images for ppc64le
133+
- name: build and push images
158134
arch: ppc64le
135+
<<: *deploy
159136
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
137+
- make image-build
138+
- make -f release/Makefile image-push
162139

163140
# Build and deploy s390x docker images
164-
- <<: *deploy
165-
name: Docker images for s390x
141+
- name: build and push images
166142
arch: s390x
143+
<<: *deploy
167144
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
145+
# Use targets directly since kuttl doesn't support s390x.
146+
- make image/ansible-operator image/helm-operator image/operator-sdk image/scorecard-test
147+
- make -f release/Makefile image-push/ansible-operator image-push/helm-operator image-push/operator-sdk image-push/scorecard-test
170148

171149
# Build and deploy ansible multi-arch manifest list
172150
- stage: deploy-manifest-multiarch
151+
name: push manifest lists
173152
<<: *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
153+
script: make -f release/Makefile image-push-multiarch

0 commit comments

Comments
 (0)