forked from ko-build/ko
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
54 lines (49 loc) · 1.68 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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