kompose/script/binary-cross
Tomas Kral 3dd7689364 Move binary target to binary-cross
use binary target only for building for current platform
2016-08-11 11:00:07 +02:00

27 lines
546 B
Bash

#!/bin/bash
set -e
if [ -z "$1" ]; then
OS_PLATFORM_ARG=(-os="darwin linux windows")
else
OS_PLATFORM_ARG=($1)
fi
if [ -z "$2" ]; then
OS_ARCH_ARG=(-arch="386 amd64")
else
OS_ARCH_ARG=($2)
fi
GITCOMMIT=$(git rev-parse --short HEAD)
# Get rid of existing binaries
rm -f kompose*
# Build binaries
gox "${OS_PLATFORM_ARG[@]}" "${OS_ARCH_ARG[@]}" \
-output="bundles/kompose_{{.OS}}-{{.Arch}}/kompose" \
-tags experimental \
-ldflags="-w -X github.com/skippbox/kompose/version.GITCOMMIT=${GITCOMMIT}" \
./cli/main