-
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
115 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,91 @@ | ||
language: go | ||
|
||
matrix: | ||
include: | ||
- os: linux | ||
sudo: required | ||
services: | ||
- docker | ||
- os: osx | ||
|
||
go: | ||
- 1.15.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 | ||
|
||
# Just declaration of the image-build-push step with script actions to execute | ||
x_base_steps: | ||
- &image-build-push | ||
services: | ||
- docker | ||
os: linux | ||
script: | ||
# skopeo upstream image build and push | ||
- export SOURCE_TYPE=upstream; export REPO=skopeo/upstream; export TAG=master | ||
- make build-arch-container | ||
# Dont's push if it's PR check | ||
- if [[ "$TRAVIS_EVENT_TYPE" != "pull_request" ]]; then make push-arch-container ; fi | ||
# skopeo stable image build and push | ||
- export SOURCE_TYPE=stable; export REPO=skopeo/stable; export TAG=v1.2.0; export EXTRA_REPO=containers/skopeo | ||
- make build-arch-container | ||
# Dont's push if it's PR check | ||
- if [[ "$TRAVIS_EVENT_TYPE" != "pull_request" ]]; then make push-arch-container ; fi | ||
|
||
# Just declaration of stage order to run | ||
stages: | ||
# Test for local build | ||
- local-build | ||
# Build and push image for 1 architecture | ||
- name: image-build-push | ||
if: branch = master | ||
# Create and push image manifest to have multi-arch image on top of arch specific images | ||
- name: multi-arch-manifest-push | ||
if: type != pull_request AND branch = master | ||
|
||
# Actual execution of steps | ||
jobs: | ||
allow_failures: | ||
- if: arch in (s390x, ppc64le) | ||
include: | ||
# Run 2 local-build steps in parallel for osx and linux/amd64 platforms | ||
- 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 | ||
|
||
# Run 3 image-build-push tasks in parallel for linux/amd64, linux/s390x and linux/ppc64le platforms (for upstream and stable) | ||
- 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 | ||
|
||
# Run final task to generate multi-arch image manifests (for upstream and stable) | ||
- 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