Skip to content

Commit

Permalink
[kueuectl] Build binaries to artifact directory (#2333)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbobrovskyi authored May 30, 2024
1 parent e2e2314 commit d0431ee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ artifacts: kustomize yq helm ## Generate release artifacts.
mv artifacts/kueue-$(GIT_TAG).tgz artifacts/kueue-chart-$(GIT_TAG).tgz
# Revert the image changes
$(YQ) e '.controllerManager.manager.image.repository = "$(IMAGE_REGISTRY)/$(IMAGE_NAME)" | .controllerManager.manager.image.tag = "main" | .controllerManager.manager.image.pullPolicy = "Always"' -i charts/kueue/values.yaml
GO_BUILD_ENV="$(GO_BUILD_ENV)" GO_CMD="$(GO_CMD)" LD_FLAGS="$(LD_FLAGS)" BUILD_DIR="artifacts/bin" BUILD_NAME=kubectl-kueue PLATFORMS="$(CLI_PLATFORMS)" ./hack/multiplatform-build.sh ./cmd/kueuectl/main.go
GO_BUILD_ENV="$(GO_BUILD_ENV)" GO_CMD="$(GO_CMD)" LD_FLAGS="$(LD_FLAGS)" BUILD_DIR="artifacts" BUILD_NAME=kubectl-kueue PLATFORMS="$(CLI_PLATFORMS)" ./hack/multiplatform-build.sh ./cmd/kueuectl/main.go

.PHONY: prepare-release-branch
prepare-release-branch: yq kustomize ## Prepare the release branch with the release version.
Expand Down
5 changes: 2 additions & 3 deletions hack/multiplatform-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ GO_BUILD_ENV=${GO_BUILD_ENV:-}
GO_CMD=${GO_CMD:-go}
LD_FLAGS=${LD_FLAGS:-}

BUILD_DIR=${BUILD_DIR:-bin}
BUILD_DIR=${BUILD_DIR}
BUILD_NAME=${BUILD_NAME:-kueuectl}
PLATFORMS=${PLATFORMS:-linux/amd64}

Expand All @@ -32,13 +32,12 @@ IFS=","
for PLATFORM in ${PLATFORMS} ; do
export GOOS="${PLATFORM%/*}"
export GOARCH="${PLATFORM#*/}"
mkdir -p "${BUILD_DIR}/${GOOS}/${GOARCH}"
EXTENSION=""

if [ ${GOOS} == "windows" ]; then
EXTENSION=".exe"
fi

echo "Building for $PLATFORM platform"
${GO_BUILD_ENV} ${GO_CMD} build -ldflags="${LD_FLAGS}" -o ${BUILD_DIR}/${GOOS}/${GOARCH}/${BUILD_NAME}${EXTENSION} $1
${GO_BUILD_ENV} ${GO_CMD} build -ldflags="${LD_FLAGS}" -o ${BUILD_DIR}/${BUILD_NAME}-${GOOS}-${GOARCH}${EXTENSION} $1
done
8 changes: 4 additions & 4 deletions site/content/en/docs/reference/kubectl-kueue/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ description: >
On Linux:
```shell
# For AMD64 / x86_64
curl -LO "https://github.com/kubernetes-sigs/kueue/releases/download/{{< param "version" >}}/bin/linux/amd64/kubectl-kueue"
[ $(uname -m) = x86_64 ] && curl -Lo ./kubectl-kueue https://github.com/kubernetes-sigs/kueue/releases/download/{{< param "version" >}}/kubectl-kueue-linux-amd64
# For ARM64
curl -LO "https://github.com/kubernetes-sigs/kueue/releases/download/{{< param "version" >}}/bin/linux/arm64/kubectl-kueue"
[ $(uname -m) = aarch64 ] && curl -Lo ./kubectl-kueue https://github.com/kubernetes-sigs/kueue/releases/download/{{< param "version" >}}/kubectl-kueue-linux-arm64
```

On Mac:
```shell
# For Intel Macs
curl -LO "https://github.com/kubernetes-sigs/kueue/releases/download/{{< param "version" >}}/bin/darwin/amd64/kubectl-kueue"
[ $(uname -m) = x86_64 ] && curl -Lo ./kubectl-kueue https://github.com/kubernetes-sigs/kueue/releases/download/{{< param "version" >}}/kubectl-kueue-darwin-amd64
# For M1 / ARM Macs
curl -LO "https://github.com/kubernetes-sigs/kueue/releases/download/{{< param "version" >}}/bin/darwin/arm64/kubectl-kueue"
[ $(uname -m) = arm64 ] && curl -Lo ./kubectl-kueue https://github.com/kubernetes-sigs/kueue/releases/download/{{< param "version" >}}/kubectl-kueue-darwin-arm64
```

### 2. Make the kubectl-kueue binary executable.
Expand Down

0 comments on commit d0431ee

Please sign in to comment.