Skip to content
Snippets Groups Projects
Commit 0c9a8eae authored by Patrick Wendell's avatar Patrick Wendell
Browse files

BUILD: Minor tweaks to internal build scripts

This adds two features:
1. The ability to publish with a different maven version than
   that specified in the release source.
2. Forking of different Zinc instances during the parallel dist
   creation (to help with some stability issues).
parent 165ff364
No related branches found
No related tags found
No related merge requests found
...@@ -34,6 +34,9 @@ ASF_PASSWORD=${ASF_PASSWORD:-XXX} ...@@ -34,6 +34,9 @@ ASF_PASSWORD=${ASF_PASSWORD:-XXX}
GPG_PASSPHRASE=${GPG_PASSPHRASE:-XXX} GPG_PASSPHRASE=${GPG_PASSPHRASE:-XXX}
GIT_BRANCH=${GIT_BRANCH:-branch-1.0} GIT_BRANCH=${GIT_BRANCH:-branch-1.0}
RELEASE_VERSION=${RELEASE_VERSION:-1.2.0} RELEASE_VERSION=${RELEASE_VERSION:-1.2.0}
# Allows publishing under a different version identifier than
# was present in the actual release sources (e.g. rc-X)
PUBLISH_VERSION=${PUBLISH_VERSION:-$RELEASE_VERSION}
NEXT_VERSION=${NEXT_VERSION:-1.2.1} NEXT_VERSION=${NEXT_VERSION:-1.2.1}
RC_NAME=${RC_NAME:-rc2} RC_NAME=${RC_NAME:-rc2}
...@@ -97,30 +100,35 @@ if [[ ! "$@" =~ --skip-publish ]]; then ...@@ -97,30 +100,35 @@ if [[ ! "$@" =~ --skip-publish ]]; then
pushd spark pushd spark
git checkout --force $GIT_TAG git checkout --force $GIT_TAG
# Substitute in case published version is different than released
old="^\( \{2,4\}\)<version>${RELEASE_VERSION}<\/version>$"
new="\1<version>${PUBLISH_VERSION}<\/version>"
find . -name pom.xml | grep -v dev | xargs -I {} sed -i \
-e "s/${old}/${new}/" {}
# Using Nexus API documented here: # Using Nexus API documented here:
# https://support.sonatype.com/entries/39720203-Uploading-to-a-Staging-Repository-via-REST-API # https://support.sonatype.com/entries/39720203-Uploading-to-a-Staging-Repository-via-REST-API
echo "Creating Nexus staging repository" echo "Creating Nexus staging repository"
repo_request="<promoteRequest><data><description>Apache Spark $GIT_TAG</description></data></promoteRequest>" repo_request="<promoteRequest><data><description>Apache Spark $GIT_TAG (published as $PUBLISH_VERSION)</description></data></promoteRequest>"
out=$(curl -X POST -d "$repo_request" -u $ASF_USERNAME:$ASF_PASSWORD \ out=$(curl -X POST -d "$repo_request" -u $ASF_USERNAME:$ASF_PASSWORD \
-H "Content-Type:application/xml" -v \ -H "Content-Type:application/xml" -v \
$NEXUS_ROOT/profiles/$NEXUS_PROFILE/start) $NEXUS_ROOT/profiles/$NEXUS_PROFILE/start)
staged_repo_id=$(echo $out | sed -e "s/.*\(orgapachespark-[0-9]\{4\}\).*/\1/") staged_repo_id=$(echo $out | sed -e "s/.*\(orgapachespark-[0-9]\{4\}\).*/\1/")
echo "Created Nexus staging repository: $staged_repo_id" echo "Created Nexus staging repository: $staged_repo_id"
rm -rf $SPARK_REPO build/mvn -DskipTests -Dhadoop.version=2.2.0 -Dyarn.version=2.2.0 \
mvn -DskipTests -Dhadoop.version=2.2.0 -Dyarn.version=2.2.0 \
-Pyarn -Phive -Phadoop-2.2 -Pspark-ganglia-lgpl -Pkinesis-asl \ -Pyarn -Phive -Phadoop-2.2 -Pspark-ganglia-lgpl -Pkinesis-asl \
clean install clean install
./dev/change-version-to-2.11.sh ./dev/change-version-to-2.11.sh
mvn -DskipTests -Dhadoop.version=2.2.0 -Dyarn.version=2.2.0 \ build/mvn -DskipTests -Dhadoop.version=2.2.0 -Dyarn.version=2.2.0 \
-Dscala-2.11 -Pyarn -Phive -Phadoop-2.2 -Pspark-ganglia-lgpl -Pkinesis-asl \ -Dscala-2.11 -Pyarn -Phive -Phadoop-2.2 -Pspark-ganglia-lgpl -Pkinesis-asl \
clean install clean install
./dev/change-version-to-2.10.sh ./dev/change-version-to-2.10.sh
rm -rf $SPARK_REPO
pushd $SPARK_REPO pushd $SPARK_REPO
# Remove any extra files generated during install # Remove any extra files generated during install
...@@ -197,6 +205,12 @@ if [[ ! "$@" =~ --skip-package ]]; then ...@@ -197,6 +205,12 @@ if [[ ! "$@" =~ --skip-package ]]; then
./dev/change-version-to-2.11.sh ./dev/change-version-to-2.11.sh
fi fi
# Create new Zinc instances for each binary release to avoid interference
# that causes OOM's and random compiler crashes.
zinc_port=${zinc_port:-3030}
zinc_port=$[$zinc_port + 1]
export ZINC_PORT=$zinc_port
./make-distribution.sh --name $NAME --tgz $FLAGS 2>&1 | tee ../binary-release-$NAME.log ./make-distribution.sh --name $NAME --tgz $FLAGS 2>&1 | tee ../binary-release-$NAME.log
cd .. cd ..
cp spark-$RELEASE_VERSION-bin-$NAME/spark-$RELEASE_VERSION-bin-$NAME.tgz . cp spark-$RELEASE_VERSION-bin-$NAME/spark-$RELEASE_VERSION-bin-$NAME.tgz .
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment