Skip to content

Commit

Permalink
Merge pull request #524 from ashcrow/build-bin-path
Browse files Browse the repository at this point in the history
Override artifact output with BIN_PATH
  • Loading branch information
Derek Gonyeo authored Mar 16, 2018
2 parents bd3876b + b2a5ddd commit 786b697
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
9 changes: 6 additions & 3 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ fi

eval $(go env)

export GOBIN=${PWD}/bin/${GOARCH}
if [ -z ${BIN_PATH+a} ]; then
export BIN_PATH=${PWD}/bin/${GOARCH}
fi

export GOPATH=${PWD}/gopath
export CGO_ENABLED=1

echo "Building ${NAME}..."
go build -ldflags "${GLDFLAGS}" -o ${GOBIN}/${NAME} ${REPO_PATH}/internal
go build -ldflags "${GLDFLAGS}" -o ${BIN_PATH}/${NAME} ${REPO_PATH}/internal

NAME="ignition-validate"

echo "Building ${NAME}..."
go build -ldflags "${GLDFLAGS}" -o ${GOBIN}/${NAME} ${REPO_PATH}/validate
go build -ldflags "${GLDFLAGS}" -o ${BIN_PATH}/${NAME} ${REPO_PATH}/validate
7 changes: 5 additions & 2 deletions build_releases
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@ fi

eval $(go env)

export GOBIN=${PWD}/bin/releases
if [ -z ${BIN_PATH+a} ]; then
export BIN_PATH=${PWD}/bin/releases/
fi

export GOPATH=${PWD}/gopath
export CGO_ENABLED=0

build_release() {
export NAME="ignition-validate-${1}"
echo "building ${NAME}"
go build -ldflags "${GLDFLAGS}" -o ${GOBIN}/${NAME} ${REPO_PATH}/validate
go build -ldflags "${GLDFLAGS}" -o ${BIN_PATH}/${NAME} ${REPO_PATH}/validate
}

export GOOS=linux
Expand Down

0 comments on commit 786b697

Please sign in to comment.