-
Notifications
You must be signed in to change notification settings - Fork 799
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add multi-arch builds for upstream and stable skopeo image via Travis
Travis is used, as it has native hardware to run the build for many architectures (amd64, s390x, ppc64le). Docker is used as build and manifest tool. `quay.io/skopeo/upstream:ma`, `quay.io/skopeo/stable:ma` and `quay.io/containers/skopeo:ma` are specified as target multi-arch upstream image. Travis config file has 3 stages: - local-build to do the local test for linux/amd64 and osx, as it was in the initial code - image-build-push to build and push images for specific architectures (amd64, s390x, ppc64le) - multi-arch-manifest-push to create and push manifest for multi-arch image - `quay.io/skopeo/upstream:master`, `quay.io/skopeo/stable:v1.2.0` and `quay.io/containers/skopeo:v1.2.0` 2 last stages are not done for pull request. 2 env variables specified in Travis settings are expected - QUAY_USERNAME and QUAY_PASSWORD to push the images to quay.io. As a result multi-arch images for 3 architectures are published. Signed-off-by: Yulia Gaponenko <[email protected]>
- Loading branch information
Showing
2 changed files
with
95 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,74 @@ | ||
language: go | ||
|
||
matrix: | ||
include: | ||
- os: linux | ||
sudo: required | ||
services: | ||
- docker | ||
- os: osx | ||
|
||
go: | ||
- 1.13.x | ||
|
||
notifications: | ||
email: false | ||
|
||
install: | ||
# Ideally, the (brew update) should not be necessary and Travis would have fairly | ||
# frequenstly updated OS images; that’s not been the case historically. | ||
# In particular, explicitly unlink python@2, which has been removed from Homebrew | ||
# since the last OS image build (as of July 2020), but the Travis OS still | ||
# contains it, and it prevents updating of Python 3. | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update && brew unlink python@2 && brew install gpgme ; fi | ||
|
||
script: | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then hack/travis_osx.sh ; fi | ||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make vendor && ./hack/tree_status.sh && make local-cross && make check ; fi | ||
env: | ||
global: | ||
- REGISTRY=quay.io | ||
|
||
x_base_steps: | ||
- &image-build-push | ||
services: | ||
- docker | ||
os: linux | ||
script: | ||
- SOURCE_TYPE=upstream REPO=skopeo/upstream TAG=master make build-push-arch-container | ||
- SOURCE_TYPE=stable REPO=skopeo/stable TAG=v1.2.0 EXTRA_REPO=containers/skopeo make build-push-arch-container | ||
|
||
stages: | ||
- local-build | ||
- name: image-build-push | ||
if: type != pull_request AND branch = master | ||
- name: multi-arch-manifest-push | ||
if: type != pull_request AND branch = master | ||
|
||
jobs: | ||
allow_failures: | ||
- if: arch in (s390x, ppc64le) | ||
include: | ||
- stage: local-build | ||
<<: *local-build | ||
name: local build for osx | ||
os: osx | ||
install: | ||
# Ideally, the (brew update) should not be necessary and Travis would have fairly | ||
# frequently updated OS images; that's not been the case historically. | ||
# In particular, explicitly unlink python@2, which has been removed from Homebrew | ||
# since the last OS image build (as of July 2020), but the Travis OS still | ||
# contains it, and it prevents updating of Python 3. | ||
- brew update && brew unlink python@2 && brew install gpgme | ||
script: | ||
- hack/travis_osx.sh | ||
- stage: local-build | ||
<<: *local-build | ||
name: local build for linux | ||
os: linux | ||
services: | ||
- docker | ||
script: | ||
- make vendor && ./hack/tree_status.sh && make local-cross && make check | ||
|
||
- stage: image-build-push | ||
<<: *image-build-push | ||
name: image for amd64 | ||
arch: amd64 | ||
|
||
- stage: image-build-push | ||
<<: *image-build-push | ||
name: image for s390x | ||
arch: s390x | ||
|
||
- stage: image-build-push | ||
<<: *image-build-push | ||
name: image for ppc64le | ||
arch: ppc64le | ||
|
||
- stage: multi-arch-manifest-push | ||
os: linux | ||
script: | ||
- SOURCE_TYPE=upstream REPO=skopeo/upstream TAG=master make push-ma-manifest | ||
- SOURCE_TYPE=stable REPO=skopeo/stable TAG=v1.2.0 EXTRA_REPO=containers/skopeo make push-ma-manifest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters