From 70812c70fcb77148709753ed4556bb774f41acf1 Mon Sep 17 00:00:00 2001 From: Bernhard Millauer Date: Fri, 3 Nov 2017 17:02:14 +0100 Subject: [PATCH] Postfix windows binaries with .exe --- script/crossbinary-default | 8 ++++++-- script/crossbinary-others | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/script/crossbinary-default b/script/crossbinary-default index 83a197438..13e3b303d 100755 --- a/script/crossbinary-default +++ b/script/crossbinary-default @@ -24,13 +24,17 @@ GIT_REPO_URL='github.com/containous/traefik/version' GO_BUILD_CMD="go build -ldflags" GO_BUILD_OPT="-s -w -X ${GIT_REPO_URL}.Version=${VERSION} -X ${GIT_REPO_URL}.Codename=${CODENAME} -X ${GIT_REPO_URL}.BuildDate=${DATE}" -# Build 386 amd64 binaries +# Build amd64 binaries OS_PLATFORM_ARG=(linux windows darwin) OS_ARCH_ARG=(amd64) for OS in ${OS_PLATFORM_ARG[@]}; do + BIN_EXT='' + if [ "$OS" == "windows" ]; then + BIN_EXT='.exe' + fi for ARCH in ${OS_ARCH_ARG[@]}; do echo "Building binary for ${OS}/${ARCH}..." - GOARCH=${ARCH} GOOS=${OS} CGO_ENABLED=0 ${GO_BUILD_CMD} "${GO_BUILD_OPT}" -o "dist/traefik_${OS}-${ARCH}" ./cmd/traefik/ + GOARCH=${ARCH} GOOS=${OS} CGO_ENABLED=0 ${GO_BUILD_CMD} "${GO_BUILD_OPT}" -o "dist/traefik_${OS}-${ARCH}${BIN_EXT}" ./cmd/traefik/ done done diff --git a/script/crossbinary-others b/script/crossbinary-others index 51d9a01b2..d0c59eb15 100755 --- a/script/crossbinary-others +++ b/script/crossbinary-others @@ -28,9 +28,13 @@ GO_BUILD_OPT="-s -w -X ${GIT_REPO_URL}.Version=${VERSION} -X ${GIT_REPO_URL}.Cod OS_PLATFORM_ARG=(linux windows darwin) OS_ARCH_ARG=(386) for OS in ${OS_PLATFORM_ARG[@]}; do + BIN_EXT='' + if [ "$OS" == "windows" ]; then + BIN_EXT='.exe' + fi for ARCH in ${OS_ARCH_ARG[@]}; do - echo "Building binary for $OS/$ARCH..." - GOARCH=${ARCH} GOOS=${OS} CGO_ENABLED=0 ${GO_BUILD_CMD} "$GO_BUILD_OPT" -o "dist/traefik_$OS-$ARCH" ./cmd/traefik/ + echo "Building binary for ${OS}/${ARCH}..." + GOARCH=${ARCH} GOOS=${OS} CGO_ENABLED=0 ${GO_BUILD_CMD} "${GO_BUILD_OPT}" -o "dist/traefik_${OS}-${ARCH}${BIN_EXT}" ./cmd/traefik/ done done