|
17 | 17 | # limitations under the License. |
18 | 18 | # |
19 | 19 |
|
| 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 | + |
20 | 29 | set -e |
21 | 30 | SELF=$(cd $(dirname $0) && pwd) |
22 | 31 | . "$SELF/release-util.sh" |
23 | 32 |
|
| 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 | + |
24 | 52 | WORKDIR= |
25 | 53 | IMGTAG=latest |
26 | 54 | JAVA= |
27 | | -while getopts "d:j:nt:" opt; do |
| 55 | +while getopts "d:hj:nt:" opt; do |
28 | 56 | case $opt in |
29 | 57 | d) WORKDIR="$OPTARG" ;; |
30 | 58 | n) DRY_RUN=1 ;; |
31 | 59 | t) IMGTAG="$OPTARG" ;; |
32 | 60 | j) JAVA="$OPTARG" ;; |
33 | | - ?) error "Invalid option: $OPTARG" ;; |
| 61 | + h) usage ;; |
| 62 | + ?) error "Invalid option. Run with -h for help." ;; |
34 | 63 | esac |
35 | 64 | done |
36 | 65 |
|
37 | 66 | 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." |
39 | 68 | fi |
40 | 69 |
|
41 | 70 | if [ -d "$WORKDIR/output" ]; then |
|
0 commit comments