Files
odo/scripts/cross-compile.sh
Tomas Kral ebe51e886b Switch from glide to go mod (#3866)
* switch to go modules

* update vendor (go mod vendor)

* swithing to go mod: update docs and makefile

* update goget-tools

* use go mod verify to check vendor

* Update goget-tools

- pin goget-tools versions
- update gikgo to 1.14.0
- reset GOFLAGS for goget-tools
- fix ginkgo get for Prow

* go mod: replace github.com/kr/pty with github.com/creack/pty

* update vendor (go mod vendor)

* fix make cross target

-mod=vendor was not used for corss compiling
2020-09-03 07:49:41 -04:00

19 lines
587 B
Bash
Executable File

#!/bin/bash
# This will cross-compile odo for all platforms:
# Windows, Linux and macOS
if [[ -z "${*}" ]]; then
echo "Build flags are missing"
exit 1
fi
for platform in linux-amd64 linux-arm64 linux-ppc64le linux-s390x darwin-amd64 windows-amd64 ; do
echo "Cross compiling $platform and placing binary at dist/bin/$platform/"
if [ $platform == "windows-amd64" ]; then
GOARCH=amd64 GOOS=windows go build -o dist/bin/$platform/odo.exe "${@}" ./cmd/odo/
else
GOARCH=${platform#*-} GOOS=${platform%-*} go build -o dist/bin/$platform/odo "${@}" ./cmd/odo/
fi
done