Skip to content

Commit b8e6dc2

Browse files
committed
[SPARK-52276][BUILD] Make ANSWER not to be overwritten in release scripts
### What changes were proposed in this pull request? This PR is rather a followup of d7d8b24 . This PR makes ANSWER not to be overwritten in release scripts. ### Why are the changes needed? ANSWER should not be overwritten. ### Does this PR introduce _any_ user-facing change? No, dev-only. ### How was this patch tested? Manually ran the script. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #50995 from HyukjinKwon/SPARK-52225-followup3. Authored-by: Hyukjin Kwon <gurwls223@apache.org> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
1 parent 83e57b0 commit b8e6dc2

File tree

2 files changed

+22
-15
lines changed

2 files changed

+22
-15
lines changed

dev/create-release/do-release-docker.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,23 @@ fi
7272

7373
if [ -d "$WORKDIR/output" ]; then
7474
if [ -z "$ANSWER" ]; then
75-
read -p "Output directory already exists. Overwrite and continue? [y/n] " ANSWER
76-
fi
77-
if [ "$ANSWER" != "y" ]; then
75+
read -p "Output directory already exists. Overwrite and continue? [y/n] " userinput
76+
if [ "$userinput" != "y" ]; then
77+
error "Exiting."
78+
fi
79+
elif [ "$ANSWER" != "y" ]; then
7880
error "Exiting."
7981
fi
8082
fi
8183

8284
if [ ! -z "$RELEASE_STEP" ] && [ "$RELEASE_STEP" = "finalize" ]; then
8385
echo "THIS STEP IS IRREVERSIBLE! Make sure the vote has passed and you pick the right RC to finalize."
8486
if [ -z "$ANSWER" ]; then
85-
read -p "You must be a PMC member to run this step. Continue? [y/n] " ANSWER
86-
fi
87-
if [ "$ANSWER" != "y" ]; then
87+
read -p "You must be a PMC member to run this step. Continue? [y/n] " userinput
88+
if [ "$userinput" != "y" ]; then
89+
error "Exiting."
90+
fi
91+
elif [ "$ANSWER" != "y" ]; then
8892
error "Exiting."
8993
fi
9094

@@ -163,7 +167,7 @@ if [ -n "$JAVA" ]; then
163167
fi
164168

165169
echo "Building $RELEASE_TAG; output will be at $WORKDIR/output"
166-
docker $([ -z "$GITHUB_ACTIONS" ] && echo "-ti") run \
170+
docker run $([ -z "$GITHUB_ACTIONS" ] && echo "-ti") \
167171
--env-file "$ENVFILE" \
168172
--volume "$WORKDIR:/opt/spark-rm" \
169173
$JAVA_VOL \

dev/create-release/release-util.sh

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,11 @@ function get_release_info {
150150
SKIP_TAG="${SKIP_TAG:-0}"
151151
if check_for_tag "$RELEASE_TAG" && [[ $SKIP_TAG = 0 ]]; then
152152
if [ -z "$ANSWER" ]; then
153-
read -p "$RELEASE_TAG already exists. Continue anyway [y/n]? " ANSWER
154-
fi
155-
if [ "$ANSWER" != "y" ]; then
153+
read -p "$RELEASE_TAG already exists. Continue anyway [y/n]? " userinput
154+
if [ "$userinput" != "y" ]; then
155+
error "Exiting."
156+
fi
157+
elif [ "$ANSWER" != "y" ]; then
156158
error "Exiting."
157159
fi
158160
SKIP_TAG=1
@@ -201,11 +203,12 @@ E-MAIL: $GIT_EMAIL
201203
EOF
202204

203205
if [ -z "$ANSWER" ]; then
204-
read -p "Is this info correct [y/n]? " ANSWER
205-
fi
206-
if [ "$ANSWER" != "y" ]; then
207-
echo "Exiting."
208-
exit 1
206+
read -p "Is this info correct [y/n]? " userinput
207+
if [ "$userinput" != "y" ]; then
208+
error "Exiting."
209+
fi
210+
elif [ "$ANSWER" != "y" ]; then
211+
error "Exiting."
209212
fi
210213

211214
if ! is_dry_run; then

0 commit comments

Comments
 (0)