From c16fb69a3a3b034a2bd1c4a1a73185ad8a199c36 Mon Sep 17 00:00:00 2001 From: Bala FA Date: Mon, 9 Sep 2024 18:17:58 +0530 Subject: [PATCH] Add info messages in sidecar release scripts (#939) Signed-off-by: Bala.FA --- sidecars/release.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/sidecars/release.sh b/sidecars/release.sh index 6696fa65..c693fc84 100644 --- a/sidecars/release.sh +++ b/sidecars/release.sh @@ -172,9 +172,15 @@ function release() { mkdir -p "${GOPATH}/src/github.com/kubernetes-csi" cd "${GOPATH}/src/github.com/kubernetes-csi" - git clone "https://github.com/kubernetes-csi/${GITHUB_PROJECT_NAME}.git" + if [ -f "${GITHUB_PROJECT_NAME}" ]; then + echo "ERROR: directory ${PWD}/${GITHUB_PROJECT_NAME} already exists" + exit 1 + fi + + echo "* Cloning repository https://github.com/kubernetes-csi/${GITHUB_PROJECT_NAME}.git" + git clone --quiet "https://github.com/kubernetes-csi/${GITHUB_PROJECT_NAME}.git" cd "${GITHUB_PROJECT_NAME}" - git checkout -b "tag-${tag}" "${tag}" + git checkout --quiet -b "tag-${tag}" "${tag}" git tag "${curr_tag}" "${tag}" generate_dockerfile @@ -182,7 +188,8 @@ function release() { export GORELEASER_CURRENT_TAG="${curr_tag}" export GORELEASER_PREVIOUS_TAG="${prev_tag}" - if [ -z "${DRY_RUN}" ]; then + if [ "${DRY_RUN}" == "1" ]; then + echo "* Doing local-only release for build test" goreleaser release --snapshot --clean else goreleaser release