Skip to content

Commit 6967ae7

Browse files
committed
Make doc generation on cherry-picks optional
1 parent 53a5ee7 commit 6967ae7

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

hack/cherry_pick_pull.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ cd "${KUBE_ROOT}"
2929
declare -r STARTINGBRANCH=$(git symbolic-ref --short HEAD)
3030
declare -r REBASEMAGIC="${KUBE_ROOT}/.git/rebase-apply"
3131
DRY_RUN=${DRY_RUN:-""}
32+
REGENERATE_DOCS=${REGENERATE_DOCS:-""}
3233
UPSTREAM_REMOTE=${UPSTREAM_REMOTE:-upstream}
3334
FORK_REMOTE=${FORK_REMOTE:-origin}
3435

@@ -54,6 +55,9 @@ if [[ "$#" -lt 2 ]]; then
5455
echo " This is useful for creating patches to a release branch without making a PR."
5556
echo " When DRY_RUN is set the script will leave you in a branch containing the commits you cherry-picked."
5657
echo
58+
echo " Set the REGENERATE_DOCS environment var to regenerate documentation for the target branch after picking the specified commits."
59+
echo " This is useful when picking commits containing changes to API documentation."
60+
echo
5761
echo " Set UPSTREAM_REMOTE (default: upstream) and FORK_REMOTE (default: origin)"
5862
echo " To override the default remote names to what you have locally."
5963
exit 2
@@ -184,12 +188,14 @@ done
184188
gitamcleanup=false
185189

186190
# Re-generate docs (if needed)
187-
echo
188-
echo "Regenerating docs..."
189-
if ! hack/generate-docs.sh; then
191+
if [[ -n "${REGENERATE_DOCS}" ]]; then
190192
echo
191-
echo "hack/generate-docs.sh FAILED to complete."
192-
exit 1
193+
echo "Regenerating docs..."
194+
if ! hack/generate-docs.sh; then
195+
echo
196+
echo "hack/generate-docs.sh FAILED to complete."
197+
exit 1
198+
fi
193199
fi
194200

195201
if [[ -n "${DRY_RUN}" ]]; then

0 commit comments

Comments
 (0)