Skip to content

Commit 7fe133a

Browse files
author
Marcelo Vanzin
committed
Small fixes.
1 parent 48eda71 commit 7fe133a

File tree

2 files changed

+34
-5
lines changed

2 files changed

+34
-5
lines changed

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

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,54 @@
1717
# limitations under the License.
1818
#
1919

20+
#
21+
# Creates a Spark release candidate. The script will update versions, tag the branch,
22+
# build Spark binary packages and documentation, and upload maven artifacts to a staging
23+
# repository. There is also a dry run mode where only local builds are performed, and
24+
# nothing is uploaded to the ASF repos.
25+
#
26+
# Run with "-h" for options.
27+
#
28+
2029
set -e
2130
SELF=$(cd $(dirname $0) && pwd)
2231
. "$SELF/release-util.sh"
2332

33+
function usage {
34+
local NAME=$(basename $0)
35+
cat <<EOF
36+
Usage: $NAME [options]
37+
38+
This script runs the release scripts inside a docker image. The image is hardcoded to be called
39+
"spark-rm" and will be re-generated (as needed) on every invocation of this script.
40+
41+
Options are:
42+
43+
-d [path] : required: working directory (output will be written to an "output" directory in
44+
the working directory).
45+
-n : dry run mode. Performs checks and local builds, but do not upload anything.
46+
-t [tag] : tag for the spark-rm docker image to use for building (default: "latest").
47+
-j [path] : path to local JDK installation to use for building. By default the script will
48+
use openjdk8 installed in the docker image.
49+
EOF
50+
}
51+
2452
WORKDIR=
2553
IMGTAG=latest
2654
JAVA=
27-
while getopts "d:j:nt:" opt; do
55+
while getopts "d:hj:nt:" opt; do
2856
case $opt in
2957
d) WORKDIR="$OPTARG" ;;
3058
n) DRY_RUN=1 ;;
3159
t) IMGTAG="$OPTARG" ;;
3260
j) JAVA="$OPTARG" ;;
33-
?) error "Invalid option: $OPTARG" ;;
61+
h) usage ;;
62+
?) error "Invalid option. Run with -h for help." ;;
3463
esac
3564
done
3665

3766
if [ -z "$WORKDIR" ] || [ ! -d "$WORKDIR" ]; then
38-
error "Work directory (-d) must be defined and exist."
67+
error "Work directory (-d) must be defined and exist. Run with -h for help."
3968
fi
4069

4170
if [ -d "$WORKDIR/output" ]; then

dev/create-release/release-util.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ function get_release_info {
137137
fi
138138
else
139139
REV=$((REV + 1))
140-
NEXT_VERSION="${SHORT_VERSION}-${REV}-SNAPSHOT"
140+
NEXT_VERSION="${SHORT_VERSION}.${REV}-SNAPSHOT"
141141
RC_COUNT=1
142142
fi
143143

@@ -149,7 +149,7 @@ function get_release_info {
149149
# Check if the RC already exists, and if re-creating the RC, skip tag creation.
150150
RELEASE_TAG="v${RELEASE_VERSION}-rc${RC_COUNT}"
151151
SKIP_TAG=0
152-
if check_for_tag "RELEASE_TAG"; then
152+
if check_for_tag "$RELEASE_TAG"; then
153153
read -p "$RELEASE_TAG already exists. Continue anyway [y/n]? " ANSWER
154154
if [ "$ANSWER" != "y" ]; then
155155
error "Exiting."

0 commit comments

Comments
 (0)