Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't try to run hack/verify-staging-* on dirty repository #42728

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 11 additions & 5 deletions hack/lib/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,18 @@ kube::util::godep_restored() {
return 0
}

# Exits script if working directory is dirty.
# Exits script if working directory is dirty. If it's run interactively in the terminal
# the user can commit changes in a second terminal. This script will wait.
kube::util::ensure_clean_working_dir() {
if ! git diff --exit-code; then
echo -e "\nUnexpected dirty working directory."
exit 1
fi
while ! git diff HEAD --exit-code &>/dev/null; do
echo -e "\nUnexpected dirty working directory:\n"
git status -s | sed 's/^/ /'
if ! tty -s; then
exit 1
fi
echo -e "\nCommit your changes in another terminal and then continue here by pressing enter."
read
done 1>&2
}

# Ensure that the given godep version is installed and in the path
Expand Down
87 changes: 0 additions & 87 deletions hack/update-all-staging.sh

This file was deleted.

13 changes: 4 additions & 9 deletions hack/update-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,30 +59,24 @@ BASH_TARGETS="
update-swagger-spec
update-openapi-spec
update-api-reference-docs
update-bazel
update-federation-openapi-spec
verify-staging-client-go
verify-staging-godeps"
update-staging-client-go
update-staging-godeps
update-bazel"

for t in $BASH_TARGETS
do
echo -e "${color_yellow}Running $t${color_norm}"
if $SILENT ; then
if ! bash "$KUBE_ROOT/hack/$t.sh" 1> /dev/null; then
echo -e "${color_red}Running $t FAILED${color_norm}"
if [[ $t == "verify"* ]]; then
echo -e "${color_red}Run ./hack/update-all-staging.sh to fix it"
fi
if ! $ALL; then
exit 1
fi
fi
else
if ! bash "$KUBE_ROOT/hack/$t.sh"; then
echo -e "${color_red}Running $t FAILED${color_norm}"
if [[ $t == "verify"* ]]; then
echo -e "${color_red}Run ./hack/update-all-staging.sh to fix it"
fi
if ! $ALL; then
exit 1
fi
Expand All @@ -91,3 +85,4 @@ do
done

echo -e "${color_green}Update scripts completed successfully${color_norm}"

3 changes: 2 additions & 1 deletion hack/update-staging-godeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ if ! kube::util::godep_restored 2>&1 | sed 's/^/ /'; then
exit 1
fi

kube::util::ensure_clean_working_dir
kube::util::ensure-temp-dir
kube::util::ensure_godep_version v74

Expand Down Expand Up @@ -85,6 +84,8 @@ for repo in $(ls ${KUBE_ROOT}/staging/src/k8s.io); do
continue
fi

kube::util::ensure_clean_working_dir

cp -a "${KUBE_ROOT}/staging/src/k8s.io/${repo}" "${TMP_GOPATH}/src/k8s.io/"

pushd "${TMP_GOPATH}/src/k8s.io/${repo}" >/dev/null
Expand Down