[SPARK-29666][BUILD] Fix the publish release failure under dry-run mode

### What changes were proposed in this pull request?

`release-build.sh` fail to publish release under dry run mode with the following error message:
```
/opt/spark-rm/release-build.sh: line 429: pushd: spark-repo-g4MBm/org/apache/spark: No such file or directory
```

We need to at least run the `mvn clean install` command once to create the `$tmp_repo` path, but now those steps are all skipped under dry-run mode. This PR fixes the issue.

### How was this patch tested?

Tested locally.

Closes #26329 from jiangxb1987/dryrun.

Authored-by: Xingbo Jiang <xingbo.jiang@databricks.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
This commit is contained in:
Xingbo Jiang 2019-10-30 14:57:51 -07:00 committed by Dongjoon Hyun
parent fd6cfb1be3
commit 155a67d00c

View file

@ -414,13 +414,13 @@ if [[ "$1" == "publish-release" ]]; then
# TODO: revisit for Scala 2.13 support
if ! is_dry_run && [[ $PUBLISH_SCALA_2_11 = 1 ]]; then
if [[ $PUBLISH_SCALA_2_11 = 1 ]]; then
./dev/change-scala-version.sh 2.11
$MVN -DzincPort=$ZINC_PORT -Dmaven.repo.local=$tmp_repo -DskipTests \
$SCALA_2_11_PROFILES $PUBLISH_PROFILES clean install
fi
if ! is_dry_run && [[ $PUBLISH_SCALA_2_12 = 1 ]]; then
if [[ $PUBLISH_SCALA_2_12 = 1 ]]; then
./dev/change-scala-version.sh 2.12
$MVN -DzincPort=$((ZINC_PORT + 2)) -Dmaven.repo.local=$tmp_repo -DskipTests \
$SCALA_2_11_PROFILES $PUBLISH_PROFILES clean install