Split binary into 2
- binary (simple traefik build) - crossbinary, cross build using gox Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
parent
4fb25ca358
commit
47015433cc
2 changed files with 31 additions and 18 deletions
|
@ -6,26 +6,9 @@ if ! test -e gen.go; then
|
||||||
false
|
false
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
rm -f dist/traefik
|
||||||
# Remove windows platform because of
|
|
||||||
# https://github.com/mailgun/log/issues/10
|
|
||||||
OS_PLATFORM_ARG=(-os="darwin linux")
|
|
||||||
else
|
|
||||||
OS_PLATFORM_ARG=($1)
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$2" ]; then
|
|
||||||
OS_ARCH_ARG=(-arch="386 amd64 arm")
|
|
||||||
else
|
|
||||||
OS_ARCH_ARG=($2)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Get rid of existing binaries
|
|
||||||
rm -f dist/traefik*
|
|
||||||
rm -rf Godeps/_workspace/pkg
|
rm -rf Godeps/_workspace/pkg
|
||||||
|
|
||||||
# Build binaries
|
# Build binaries
|
||||||
CGO_ENABLED=0 godep go build -a -installsuffix nocgo -o dist/traefik .
|
CGO_ENABLED=0 godep go build -a -installsuffix nocgo -o dist/traefik .
|
||||||
GOPATH=`godep path`:$GOPATH gox "${OS_PLATFORM_ARG[@]}" "${OS_ARCH_ARG[@]}" \
|
|
||||||
-output="dist/traefik_{{.OS}}-{{.Arch}}"
|
|
||||||
|
|
||||||
|
|
30
script/crossbinary
Executable file
30
script/crossbinary
Executable file
|
@ -0,0 +1,30 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if ! test -e gen.go; then
|
||||||
|
echo >&2 'error: generate must be run before binary'
|
||||||
|
false
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
# Remove windows platform because of
|
||||||
|
# https://github.com/mailgun/log/issues/10
|
||||||
|
OS_PLATFORM_ARG=(-os="darwin linux")
|
||||||
|
else
|
||||||
|
OS_PLATFORM_ARG=($1)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$2" ]; then
|
||||||
|
OS_ARCH_ARG=(-arch="386 amd64 arm")
|
||||||
|
else
|
||||||
|
OS_ARCH_ARG=($2)
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Get rid of existing binaries
|
||||||
|
rm -f dist/traefik_*
|
||||||
|
rm -rf Godeps/_workspace/pkg
|
||||||
|
|
||||||
|
# Build binaries
|
||||||
|
GOPATH=`godep path`:$GOPATH gox "${OS_PLATFORM_ARG[@]}" "${OS_ARCH_ARG[@]}" \
|
||||||
|
-output="dist/traefik_{{.OS}}-{{.Arch}}"
|
||||||
|
|
Loading…
Reference in a new issue