Skip to content

Commit

Permalink
fix various shell bugs (kubernetes-sigs#868)
Browse files Browse the repository at this point in the history
* fix errors in scripts/ci-build.gitsh

* fix errors in scripts/ci-integration.sh

* fix errors in scripts/ci-is-vendor-in-sync.sh

* fix errors in scripts/ci-make.sh

* fix errors in scripts/ci-test.sh

* removed unused variables from scripts/fetch_ext_bins.sh

* fix errors in hack/update-bazel.sh

* fix errors in hack/verify_clientset.sh
  • Loading branch information
BenTheElder authored and serbrech committed Apr 8, 2019
1 parent 5029e1c commit 578011a
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 16 deletions.
7 changes: 4 additions & 3 deletions hack/update-bazel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ set -o errexit
set -o nounset
set -o pipefail

export KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
export KUBE_ROOT

cd $KUBE_ROOT
find $KUBE_ROOT/vendor -name 'BUILD' -delete
cd "${KUBE_ROOT}"
find "${KUBE_ROOT}/vendor" -name 'BUILD' -delete
bazel run //:gazelle
3 changes: 2 additions & 1 deletion hack/verify_clientset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ set -o errexit
set -o nounset
set -o pipefail

SCRIPT_ROOT=$(dirname "${BASH_SOURCE}")/..
SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
DIFFROOT="${SCRIPT_ROOT}/pkg/client"
TMP_DIFFROOT="${SCRIPT_ROOT}/_tmp/pkg"
_tmp="${SCRIPT_ROOT}/_tmp"
GOPATH=$(go env GOPATH)
export GOPATH

cleanup() {
rm -rf "${_tmp}"
Expand Down
4 changes: 2 additions & 2 deletions scripts/ci-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ set -o errexit
set -o nounset
set -o pipefail

REPO_ROOT=$(dirname "${BASH_SOURCE}")/..
REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/..

cd $REPO_ROOT && make manager clusterctl
cd "$REPO_ROOT" && make manager clusterctl
5 changes: 3 additions & 2 deletions scripts/ci-integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ install_kubectl() {
}

build_containers() {
VERSION=$(git describe --exact-match 2> /dev/null || git describe --match=$(git rev-parse --short=8 HEAD) --always --dirty --abbrev=8)
VERSION="$(git describe --exact-match 2> /dev/null || git describe --match="$(git rev-parse --short=8 HEAD)" --always --dirty --abbrev=8)"
CONTROLLER_IMG="${CONTROLLER_REPO}:${VERSION}"
EXAMPLE_PROVIDER_IMG="${EXAMPLE_PROVIDER_REPO}:${VERSION}"
export CONTROLLER_IMG="${CONTROLLER_IMG}"
Expand All @@ -58,7 +58,8 @@ prepare_crd_yaml() {
create_bootstrap() {
go get sigs.k8s.io/kind
kind create cluster --name "${BOOTSTRAP_CLUSTER_NAME}"
export KUBECONFIG="$(kind get kubeconfig-path --name="${BOOTSTRAP_CLUSTER_NAME}")"
KUBECONFIG="$(kind get kubeconfig-path --name="${BOOTSTRAP_CLUSTER_NAME}")"
export KUBECONFIG

kind load docker-image "${CONTROLLER_IMG}" --name "${BOOTSTRAP_CLUSTER_NAME}"
kind load docker-image "${EXAMPLE_PROVIDER_IMG}" --name "${BOOTSTRAP_CLUSTER_NAME}"
Expand Down
4 changes: 2 additions & 2 deletions scripts/ci-is-vendor-in-sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ set -o errexit
set -o nounset
set -o pipefail

REPO_ROOT=$(dirname "${BASH_SOURCE}")/..
REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/..

cd $REPO_ROOT
cd "$REPO_ROOT"
find vendor -name 'BUILD.bazel' -delete
dep check
4 changes: 2 additions & 2 deletions scripts/ci-make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ set -o errexit
set -o nounset
set -o pipefail

REPO_ROOT=$(dirname "${BASH_SOURCE}")/..
REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/..

cd $REPO_ROOT && make lint-full docker-build
cd "$REPO_ROOT" && make lint-full docker-build
4 changes: 2 additions & 2 deletions scripts/ci-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ set -o errexit
set -o nounset
set -o pipefail

REPO_ROOT=$(dirname "${BASH_SOURCE}")/..
REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/..

cd $REPO_ROOT && \
cd "$REPO_ROOT" && \
source ./scripts/fetch_ext_bins.sh && \
fetch_tools && \
setup_envs && \
Expand Down
2 changes: 0 additions & 2 deletions scripts/fetch_ext_bins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,9 @@ function header_text {
echo "$header$*$reset"
}

rc=0
tmp_root=/tmp

kb_root_dir=$tmp_root/kubebuilder
kb_orig=$(pwd)

# Skip fetching and untaring the tools by setting the SKIP_FETCH_TOOLS variable
# in your environment to any value:
Expand Down

0 comments on commit 578011a

Please sign in to comment.