forked from LaconicNetwork/kompose
Move binary target to binary-cross
use binary target only for building for current platform
This commit is contained in:
parent
1b501619b7
commit
3dd7689364
6
Makefile
6
Makefile
@ -16,3 +16,9 @@ all:
|
||||
|
||||
binary:
|
||||
CGO_ENABLED=0 ./script/make.sh binary
|
||||
|
||||
binary-cross:
|
||||
CGO_ENABLED=0 ./script/make.sh binary-cross
|
||||
|
||||
clean:
|
||||
./script/make.sh clean
|
||||
|
||||
@ -1,26 +1,12 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
OS_PLATFORM_ARG=(-os="darwin linux windows")
|
||||
else
|
||||
OS_PLATFORM_ARG=($1)
|
||||
fi
|
||||
# Get rid of existing binary
|
||||
rm -f kompose
|
||||
|
||||
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" \
|
||||
# Build binary
|
||||
go build \
|
||||
-tags experimental \
|
||||
-o kompose \
|
||||
-ldflags="-w -X github.com/skippbox/kompose/version.GITCOMMIT=${GITCOMMIT}" \
|
||||
./cli/main
|
||||
|
||||
26
script/binary-cross
Normal file
26
script/binary-cross
Normal file
@ -0,0 +1,26 @@
|
||||
#!/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
|
||||
Loading…
Reference in New Issue
Block a user