forked from gardener/gardenctl-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build for linux/arm64 (gardener#358)
- Loading branch information
1 parent
1d68378
commit ec2751d
Showing
8 changed files
with
83 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
# SPDX-FileCopyrightText: 2021 SAP SE or an SAP affiliate company and Gardener contributors | ||
# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and Gardener contributors | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set -e | ||
|
||
# For the build step concourse will set the following environment variables: | ||
# SOURCE_PATH - path to component repository root directory. | ||
# BINARY_PATH - path to an existing (empty) directory to place build results into. | ||
|
||
if [[ -z "${MAIN_REPO_DIR}" ]]; then | ||
export MAIN_REPO_DIR="$(readlink -f $(dirname ${0})/..)" | ||
else | ||
export MAIN_REPO_DIR="$(readlink -f "${MAIN_REPO_DIR}")" | ||
fi | ||
|
||
if [[ -z "${BINARY_PATH}" ]]; then | ||
export BINARY_PATH="${MAIN_REPO_DIR}/bin" | ||
else | ||
export BINARY_PATH="$(readlink -f "${BINARY_PATH}")" | ||
fi | ||
|
||
pushd "${MAIN_REPO_DIR}" > /dev/null | ||
|
||
if [[ -z "${LD_FLAGS}" ]]; then | ||
export LD_FLAGS=$(./hack/get-build-ld-flags.sh) | ||
fi | ||
############################################################################### | ||
|
||
out_file="${BINARY_PATH}"/darwin-amd64/gardenctl_v2_darwin_amd64 | ||
|
||
echo "building for darwin-amd64: ${out_file}" | ||
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 GO111MODULE=on go build \ | ||
-ldflags "${LD_FLAGS}" \ | ||
-o "${out_file}" main.go | ||
export GOOS=darwin | ||
export GOARCH=amd64 | ||
|
||
popd > /dev/null | ||
${MAIN_REPO_DIR}/hack/build.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
# SPDX-FileCopyrightText: 2021 SAP SE or an SAP affiliate company and Gardener contributors | ||
# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and Gardener contributors | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set -e | ||
|
||
# For the build step concourse will set the following environment variables: | ||
# SOURCE_PATH - path to component repository root directory. | ||
# BINARY_PATH - path to an existing (empty) directory to place build results into. | ||
|
||
if [[ -z "${MAIN_REPO_DIR}" ]]; then | ||
export MAIN_REPO_DIR="$(readlink -f $(dirname ${0})/..)" | ||
else | ||
export MAIN_REPO_DIR="$(readlink -f "${MAIN_REPO_DIR}")" | ||
fi | ||
|
||
if [[ -z "${BINARY_PATH}" ]]; then | ||
export BINARY_PATH="${MAIN_REPO_DIR}/bin" | ||
else | ||
export BINARY_PATH="$(readlink -f "${BINARY_PATH}")" | ||
fi | ||
|
||
pushd "${MAIN_REPO_DIR}" > /dev/null | ||
|
||
if [[ -z "${LD_FLAGS}" ]]; then | ||
export LD_FLAGS=$(./hack/get-build-ld-flags.sh) | ||
fi | ||
############################################################################### | ||
|
||
out_file="${BINARY_PATH}"/linux-amd64/gardenctl_v2_linux_amd64 | ||
|
||
echo "building for linux-amd64: ${out_file}" | ||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build \ | ||
-ldflags "${LD_FLAGS}" \ | ||
-o "${out_file}" main.go | ||
export GOOS=linux | ||
export GOARCH=amd64 | ||
|
||
popd > /dev/null | ||
${MAIN_REPO_DIR}/hack/build.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and Gardener contributors | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# For the build step concourse will set the following environment variables: | ||
# SOURCE_PATH - path to component repository root directory. | ||
|
||
if [[ -z "${MAIN_REPO_DIR}" ]]; then | ||
export MAIN_REPO_DIR="$(readlink -f $(dirname ${0})/..)" | ||
else | ||
export MAIN_REPO_DIR="$(readlink -f "${MAIN_REPO_DIR}")" | ||
fi | ||
|
||
export GOOS=linux | ||
export GOARCH=arm64 | ||
|
||
${MAIN_REPO_DIR}/hack/build.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
# SPDX-FileCopyrightText: 2021 SAP SE or an SAP affiliate company and Gardener contributors | ||
# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and Gardener contributors | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set -e | ||
|
||
# For the build step concourse will set the following environment variables: | ||
# SOURCE_PATH - path to component repository root directory. | ||
# BINARY_PATH - path to an existing (empty) directory to place build results into. | ||
|
||
if [[ -z "${MAIN_REPO_DIR}" ]]; then | ||
export MAIN_REPO_DIR="$(readlink -f $(dirname ${0})/..)" | ||
else | ||
export MAIN_REPO_DIR="$(readlink -f "${MAIN_REPO_DIR}")" | ||
fi | ||
|
||
if [[ -z "${BINARY_PATH}" ]]; then | ||
export BINARY_PATH="${MAIN_REPO_DIR}/bin" | ||
else | ||
export BINARY_PATH="$(readlink -f "${BINARY_PATH}")" | ||
fi | ||
|
||
pushd "${MAIN_REPO_DIR}" > /dev/null | ||
|
||
if [[ -z "${LD_FLAGS}" ]]; then | ||
export LD_FLAGS=$(./hack/get-build-ld-flags.sh) | ||
fi | ||
############################################################################### | ||
|
||
out_file="${BINARY_PATH}"/windows-amd64/gardenctl_v2_windows_amd64.exe | ||
|
||
echo "building for windows-amd64: ${out_file}" | ||
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 GO111MODULE=on go build \ | ||
-ldflags "${LD_FLAGS}" \ | ||
-o "${out_file}" main.go | ||
export GOOS=windows | ||
export GOARCH=amd64 | ||
|
||
popd > /dev/null | ||
${MAIN_REPO_DIR}/hack/build.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env bash | ||
|
||
# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and Gardener contributors | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set -e | ||
|
||
# For the build step concourse will set the following environment variables: | ||
# SOURCE_PATH - path to component repository root directory. | ||
# BINARY_PATH - path to an existing (empty) directory to place build results into. | ||
|
||
if [[ -z "${MAIN_REPO_DIR}" ]]; then | ||
export MAIN_REPO_DIR="$(readlink -f $(dirname ${0})/..)" | ||
else | ||
export MAIN_REPO_DIR="$(readlink -f "${MAIN_REPO_DIR}")" | ||
fi | ||
|
||
if [[ -z "${BINARY_PATH}" ]]; then | ||
export BINARY_PATH="${MAIN_REPO_DIR}/bin" | ||
else | ||
export BINARY_PATH="$(readlink -f "${BINARY_PATH}")" | ||
fi | ||
|
||
pushd "${MAIN_REPO_DIR}" > /dev/null | ||
|
||
if [[ -z "${LD_FLAGS}" ]]; then | ||
export LD_FLAGS=$("${MAIN_REPO_DIR}/hack/get-build-ld-flags.sh") | ||
fi | ||
############################################################################### | ||
|
||
out_file="${BINARY_PATH}/${GOOS}-${GOARCH}/gardenctl_v2_${GOOS}_${GOARCH}" | ||
|
||
echo "building for ${GOOS}-${GOARCH}: ${out_file}" | ||
CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} GO111MODULE=on go build \ | ||
-ldflags "${LD_FLAGS}" \ | ||
-o "${out_file}" main.go | ||
|
||
popd > /dev/null |