Skip to content

Commit

Permalink
Fix ci build
Browse files Browse the repository at this point in the history
OUTPUT_NAME was referenced from OUTPUT_NAME variable,
which was calculated at first loop turn and its value
was the same across other loop turns.

This patch will introduce local output name variable.

Signed-off-by: Piotr Persona <[email protected]>
  • Loading branch information
piotrpersona committed Sep 2, 2019
1 parent a4c53ec commit 65e3dce
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,13 @@ function __build_docku() {
local PLATFORM_SPLIT=( ${platform//\// } )
local GOOS=${PLATFORM_SPLIT[0]}
local GOARCH="${PLATFORM_SPLIT[1]}"
local OUTPUT_NAME="${OUTPUT_NAME:-"${PACKAGE_NAME}-${GOOS}-${GOARCH}"}"

local output_name="${OUTPUT_NAME:-"${PACKAGE_NAME}-${GOOS}-${GOARCH}"}"
if [[ "${GOOS}" = "windows" ]]; then
OUTPUT_NAME+='.exe'
output_name+='.exe'
fi

env GOOS="${GOOS}" GOARCH="${GOARCH}" go build -ldflags "${LDFLAGS}" \
-o "${GOPATH}/bin/${OUTPUT_NAME}" "${PACKAGE}"
-o "${GOPATH}/bin/${output_name}" "${PACKAGE}"
if [[ "${?}" -ne 0 ]]; then
echo 'An error has occurred! Aborting the script execution...'
exit 1
Expand Down

0 comments on commit 65e3dce

Please sign in to comment.