Skip to content

Commit

Permalink
fix: make binary failed
Browse files Browse the repository at this point in the history
  • Loading branch information
Abirdcfly committed Oct 21, 2022
1 parent 4f597da commit a18b3d7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions hack/lib/golang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ function go::build_binary_for_platform() {
local -r os=${platform%/*}
local -r arch=${platform##*/}

cd "${CODE_PATH[$target]}"
set -x
cd ${CODE_PATH[$target]} && go mod vendor && cd -
CGO_ENABLED=0 GOOS=${os} GOARCH=${arch} go build \
GO111MODULE=on CGO_ENABLED=0 GOOS=${os} GOARCH=${arch} go install \
-ldflags "${LDFLAGS:-}" \
-o "_output/bin/${platform}/$target" \
"$BUILD_GOPATH/src/$PACKAGE_NAME/${CODE_MAIN_PATH[$target]}"
"${CODE_MAIN_PATH[$target]}"
set +x
cd -
}

function go::host_platform() {
Expand Down Expand Up @@ -85,4 +85,6 @@ function go::setup_env() {
export GOROOT

unset GOBIN

cd "$BUILD_GOPATH/src/$PACKAGE_NAME"
}
6 changes: 3 additions & 3 deletions hack/lib/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ declare -A CODE_PATH=(
)

declare -A CODE_MAIN_PATH=(
["observer-metric-server"]="observer-plugins/metric-server/main.go"
["observer-prometheus-server"]="observer-plugins/prometheus/main.go"
["executor-resource-tagger"]="executor-plugins/resource-tagger/cmd/server/server.go"
["observer-metric-server"]="main.go"
["observer-prometheus-server"]="main.go"
["executor-resource-tagger"]="cmd/server/server.go"
)

declare -A DOCKERFILE_PATH=(
Expand Down

0 comments on commit a18b3d7

Please sign in to comment.