Skip to content

Commit d63d4be

Browse files
tariq1890k8s-ci-robot
authored andcommitted
clean up shell scripts in cluster-api (#1045)
1 parent 2123eed commit d63d4be

File tree

6 files changed

+26
-26
lines changed

6 files changed

+26
-26
lines changed

scripts/ci-build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ set -o pipefail
2020

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

23-
cd "$REPO_ROOT" && make manager clusterctl
23+
cd "${REPO_ROOT}" && make manager clusterctl

scripts/ci-integration.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ build_containers() {
5454
export CONTROLLER_IMG="${CONTROLLER_REPO}"
5555
export EXAMPLE_PROVIDER_IMG="${EXAMPLE_PROVIDER_REPO}"
5656

57-
"${MAKE}" docker-build TAG=${VERSION} ARCH=${GOARCH}
58-
"${MAKE}" docker-build-ci TAG=${VERSION} ARCH=${GOARCH}
57+
"${MAKE}" docker-build TAG="${VERSION}" ARCH="${GOARCH}"
58+
"${MAKE}" docker-build-ci TAG="${VERSION}" ARCH="${GOARCH}"
5959
}
6060

6161
prepare_crd_yaml() {
@@ -85,7 +85,7 @@ wait_pod_running() {
8585
do
8686
sleep ${INTERVAL};
8787
retry=$((retry - 1))
88-
if [ $retry -lt 0 ];
88+
if [[ $retry -lt 0 ]];
8989
then
9090
kubectl describe pod "$1" -n "$2"
9191
kubectl logs "$1" -n "$2"
@@ -96,7 +96,7 @@ wait_pod_running() {
9696
}
9797

9898
ensure_docker_in_docker() {
99-
if [ -z "${PROW_JOB_ID}" ] ; then
99+
if [[ -z "${PROW_JOB_ID}" ]] ; then
100100
# start docker service in setup other than Prow
101101
service docker start
102102
fi
@@ -121,7 +121,7 @@ main() {
121121
wait_pod_running "provider-controller-manager-0" "provider-system"
122122
set -e
123123

124-
if [ -d "${INTEGRATION_TEST_DIR}" ] ; then
124+
if [[ -d "${INTEGRATION_TEST_DIR}" ]] ; then
125125
go test -v "${INTEGRATION_TEST_DIR}"/...
126126
fi
127127

scripts/ci-is-vendor-in-sync.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ set -o pipefail
2020

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

23-
cd "$REPO_ROOT"
23+
cd "${REPO_ROOT}"
2424
find vendor -name 'BUILD.bazel' -delete
2525
dep check

scripts/ci-make.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ set -o pipefail
2020

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

23-
cd "$REPO_ROOT" && make lint-full docker-build
23+
cd "${REPO_ROOT}" && make lint-full docker-build

scripts/ci-test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ set -o pipefail
2020

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

23-
cd "$REPO_ROOT" && \
23+
cd "${REPO_ROOT}" && \
2424
source ./scripts/fetch_ext_bins.sh && \
2525
fetch_tools && \
2626
setup_envs && \

scripts/fetch_ext_bins.sh

+17-17
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ set -o pipefail
2222
#
2323
# $ TRACE=1 test.sh
2424
TRACE=${TRACE:-""}
25-
if [ -n "$TRACE" ]; then
25+
if [[ -n "${TRACE}" ]]; then
2626
set -x
2727
fi
2828

@@ -31,9 +31,9 @@ k8s_version=1.11.0
3131
goarch=amd64
3232
goos="unknown"
3333

34-
if [[ "$OSTYPE" == "linux"* ]]; then
34+
if [[ "${OSTYPE}" == "linux"* ]]; then
3535
goos="linux"
36-
elif [[ "$OSTYPE" == "darwin"* ]]; then
36+
elif [[ "${OSTYPE}" == "darwin"* ]]; then
3737
goos="darwin"
3838
fi
3939

@@ -47,7 +47,7 @@ fi
4747
#
4848
# $ NO_COLOR=1 test.sh
4949
NO_COLOR=${NO_COLOR:-""}
50-
if [ -z "$NO_COLOR" ]; then
50+
if [[ -z "${NO_COLOR}" ]]; then
5151
header=$'\e[1;33m'
5252
reset=$'\e[0m'
5353
else
@@ -61,7 +61,7 @@ function header_text {
6161

6262
tmp_root=/tmp
6363

64-
kb_root_dir=$tmp_root/kubebuilder
64+
kb_root_dir=${tmp_root}/kubebuilder
6565

6666
# Skip fetching and untaring the tools by setting the SKIP_FETCH_TOOLS variable
6767
# in your environment to any value:
@@ -75,30 +75,30 @@ SKIP_FETCH_TOOLS=${SKIP_FETCH_TOOLS:-""}
7575
function prepare_staging_dir {
7676
header_text "preparing staging dir"
7777

78-
if [ -z "$SKIP_FETCH_TOOLS" ]; then
79-
rm -rf "$kb_root_dir"
78+
if [[ -z "${SKIP_FETCH_TOOLS}" ]]; then
79+
rm -rf "${kb_root_dir}"
8080
else
81-
rm -f "$kb_root_dir/kubebuilder/bin/kubebuilder"
82-
rm -f "$kb_root_dir/kubebuilder/bin/kubebuilder-gen"
83-
rm -f "$kb_root_dir/kubebuilder/bin/vendor.tar.gz"
81+
rm -f "${kb_root_dir}/kubebuilder/bin/kubebuilder"
82+
rm -f "${kb_root_dir}/kubebuilder/bin/kubebuilder-gen"
83+
rm -f "${kb_root_dir}/kubebuilder/bin/vendor.tar.gz"
8484
fi
8585
}
8686

8787
# fetch k8s API gen tools and make it available under kb_root_dir/bin.
8888
function fetch_tools {
89-
if [ -n "$SKIP_FETCH_TOOLS" ]; then
89+
if [[ -n "$SKIP_FETCH_TOOLS" ]]; then
9090
return 0
9191
fi
9292

9393
header_text "fetching tools"
94-
kb_tools_archive_name="kubebuilder-tools-$k8s_version-$goos-$goarch.tar.gz"
95-
kb_tools_download_url="https://storage.googleapis.com/kubebuilder-tools/$kb_tools_archive_name"
94+
kb_tools_archive_name="kubebuilder-tools-${k8s_version}-${goos}-${goarch}.tar.gz"
95+
kb_tools_download_url="https://storage.googleapis.com/kubebuilder-tools/${kb_tools_archive_name}"
9696

97-
kb_tools_archive_path="$tmp_root/$kb_tools_archive_name"
98-
if [ ! -f $kb_tools_archive_path ]; then
99-
curl -fsL ${kb_tools_download_url} -o "$kb_tools_archive_path"
97+
kb_tools_archive_path="${tmp_root}/${kb_tools_archive_name}"
98+
if [[ ! -f ${kb_tools_archive_path} ]]; then
99+
curl -fsL ${kb_tools_download_url} -o "${kb_tools_archive_path}"
100100
fi
101-
tar -zvxf "$kb_tools_archive_path" -C "$tmp_root/"
101+
tar -zvxf "${kb_tools_archive_path}" -C "${tmp_root}/"
102102
}
103103

104104
function setup_envs {

0 commit comments

Comments
 (0)