Files
ko-build/.travis.yml
T
jonjohnsonjrandMatt Moore 7e3245343a Allow comma-separated list of platforms (#259)
* Allow comma-separated list of platforms

* Parse platform spec once

* Update --platform docs in README

* Update pkg/build/gobuild_test.go

Co-authored-by: Matt Moore <mattmoor@vmware.com>

* Return err for bad defaulting for --platform

Also respect GOARM as variant if the goarch is arm.

* Refactor platform matching

* Update README.md to mention GOARM

* Fix travis test

Co-authored-by: Matt Moore <mattmoor@vmware.com>
2020-12-21 16:53:00 -08:00

55 lines
1.7 KiB
YAML

dist: bionic
language: go
go:
- '1.15'
git:
depth: 1
jobs:
include:
- arch: amd64
- arch: arm64
- arch: s390x
- arch: ppc64le
script:
# Make sure ko compiles for the right architecture.
- eval $(go env)
- go install -mod=vendor ./cmd/ko
# Try with all, and GOOS/GOARCH set.
- |
OUTPUT=$(GOOS=${GOOS} GOARCH=${GOARCH} KO_DOCKER_REPO=ko.local ko publish --platform=all -B ./cmd/ko/test 2>&1)
if [[ ! "${OUTPUT}" =~ "cannot use --platform with GOOS=\"${GOOS}\"" ]]; then
echo Mismatched output: ${OUTPUT}, wanted: "cannot use --platform with GOOS=\"${GOOS}\""
exit 1
fi
# Try with the appropriate platform.
- |
KO_DOCKER_REPO=ko.local ko publish --platform=${GOOS}/${GOARCH} -B ./cmd/ko/test
OUTPUT=$(docker run -i ko.local/test -wait=false 2>&1)
if [[ ! "${OUTPUT}" =~ "$(cat ./cmd/ko/test/kodata/kenobi)" ]]; then
echo Mismatched output: ${OUTPUT}, wanted: $(cat ./cmd/ko/test/kodata/kenobi)
exit 1
fi
if [[ ! "${OUTPUT}" =~ "$(cat ./cmd/ko/test/kodata/HEAD)" ]]; then
echo Mismatched output: ${OUTPUT}, wanted: $(cat ./cmd/ko/test/kodata/HEAD)
exit 1
fi
# Try with just GOOS/GOARCH
- |
GOOS=${GOOS} GOARCH=${GOARCH} KO_DOCKER_REPO=ko.local ko publish -B ./cmd/ko/test
OUTPUT=$(docker run -i ko.local/test -wait=false 2>&1)
if [[ ! "${OUTPUT}" =~ "$(cat ./cmd/ko/test/kodata/kenobi)" ]]; then
echo Mismatched output: ${OUTPUT}, wanted: $(cat ./cmd/ko/test/kodata/kenobi)
exit 1
fi
if [[ ! "${OUTPUT}" =~ "$(cat ./cmd/ko/test/kodata/HEAD)" ]]; then
echo Mismatched output: ${OUTPUT}, wanted: $(cat ./cmd/ko/test/kodata/HEAD)
exit 1
fi
notifications:
email: false