Normalize ROOT
naming and calculation in hack/
This commit is contained in:
parent
031129778e
commit
e48d9faf27
@ -1,10 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
|
||||||
|
|
||||||
set -o errexit
|
KUBE_ROOT="${ROOT}" # required by `hack/lib/version.sh`
|
||||||
set -o nounset
|
source "${ROOT}/hack/lib/version.sh"
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
|
||||||
source "${KUBE_ROOT}/hack/lib/version.sh"
|
|
||||||
|
|
||||||
kube::version::ldflags
|
kube::version::ldflags
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
|
||||||
root_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
|
|
||||||
|
|
||||||
function tidy_cmd() {
|
function tidy_cmd() {
|
||||||
echo 'go mod tidy -v'
|
echo 'go mod tidy -v'
|
||||||
@ -48,7 +47,7 @@ function with_modules() {
|
|||||||
local cmd_function="${1}"
|
local cmd_function="${1}"
|
||||||
cmd="$(${cmd_function})"
|
cmd="$(${cmd_function})"
|
||||||
|
|
||||||
pushd "${root_dir}"
|
pushd "${ROOT}"
|
||||||
for mod_file in $(find . -maxdepth 4 -name go.mod | sort); do
|
for mod_file in $(find . -maxdepth 4 -name go.mod | sort); do
|
||||||
mod_dir="$(dirname "${mod_file}")"
|
mod_dir="$(dirname "${mod_file}")"
|
||||||
(
|
(
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
# Copyright 2020 VMware, Inc.
|
# Copyright 2020 VMware, Inc.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
ROOT="$(realpath "$(dirname "${BASH_SOURCE[0]}")/..")"
|
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
|
||||||
|
|
||||||
"$ROOT/hack/module.sh" unittest
|
"$ROOT/hack/module.sh" unittest
|
@ -3,8 +3,8 @@
|
|||||||
# Copyright 2020 VMware, Inc.
|
# Copyright 2020 VMware, Inc.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
|
||||||
|
|
||||||
ROOT="$(realpath "$(dirname "${BASH_SOURCE[0]}")/..")"
|
|
||||||
BASE_PKG="github.com/suzerain-io/placeholder-name"
|
BASE_PKG="github.com/suzerain-io/placeholder-name"
|
||||||
CODEGEN_IMAGE=${CODEGEN_IMAGE:-gcr.io/tanzu-user-authentication/k8s-code-generator-1.19:latest}
|
CODEGEN_IMAGE=${CODEGEN_IMAGE:-gcr.io/tanzu-user-authentication/k8s-code-generator-1.19:latest}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
# Copyright 2020 VMware, Inc.
|
# Copyright 2020 VMware, Inc.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
ROOT="$(realpath "$(dirname "${BASH_SOURCE[0]}")/..")"
|
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
|
||||||
|
|
||||||
"$ROOT/hack/module.sh" tidy
|
"$ROOT/hack/module.sh" tidy
|
||||||
"$ROOT/hack/update-codegen.sh"
|
"$ROOT/hack/update-codegen.sh"
|
@ -15,8 +15,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
|
||||||
ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
|
||||||
|
|
||||||
DIFFROOT="${ROOT}/kubernetes"
|
DIFFROOT="${ROOT}/kubernetes"
|
||||||
TMP_DIFFROOT="${ROOT}/_tmp/kubernetes"
|
TMP_DIFFROOT="${ROOT}/_tmp/kubernetes"
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
# Copyright 2020 VMware, Inc.
|
# Copyright 2020 VMware, Inc.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
ROOT="$(realpath "$(dirname "${BASH_SOURCE[0]}")/..")"
|
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
|
||||||
|
|
||||||
"$ROOT/hack/module.sh" lint
|
"$ROOT/hack/module.sh" lint
|
||||||
"$ROOT/hack/verify-codegen.sh"
|
"$ROOT/hack/verify-codegen.sh"
|
||||||
|
Loading…
Reference in New Issue
Block a user