flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject flink git commit: [scripts] Sync release script with master
Date Thu, 27 Aug 2015 07:41:19 GMT
Repository: flink
Updated Branches:
  refs/heads/release-0.9 9f2f6b7bb -> b8834bcc1


[scripts] Sync release script with master


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/b8834bcc
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/b8834bcc
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/b8834bcc

Branch: refs/heads/release-0.9
Commit: b8834bcc1cf433cdf9849aad1758875c30562c35
Parents: 9f2f6b7
Author: Ufuk Celebi <uce@apache.org>
Authored: Thu Aug 27 09:38:43 2015 +0200
Committer: Ufuk Celebi <uce@apache.org>
Committed: Thu Aug 27 09:40:56 2015 +0200

----------------------------------------------------------------------
 tools/create_release_files.sh | 178 +++++++++++++++++++++++--------------
 1 file changed, 109 insertions(+), 69 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/b8834bcc/tools/create_release_files.sh
----------------------------------------------------------------------
diff --git a/tools/create_release_files.sh b/tools/create_release_files.sh
index 367ba05..26747c7 100755
--- a/tools/create_release_files.sh
+++ b/tools/create_release_files.sh
@@ -29,6 +29,30 @@
 #  https://github.com/apache/spark/blob/master/dev/create-release/create-release.sh
 #
 
+##
+#
+#   Flink release script
+#   ===================
+#
+#   Can be called like this:
+#
+#    sonatype_user=APACHEID sonatype_pw=APACHEIDPASSWORD \
+#     NEW_VERSION=0.9.0 \
+#     RELEASE_CANDIDATE="rc1" RELEASE_BRANCH=release-0.9.0
+#     OLD_VERSION=0.9-SNAPSHOT \
+#     USER_NAME=APACHEID \
+#     GPG_PASSPHRASE=XXX GPG_KEY=KEYID \
+#     GIT_AUTHOR="`git config --get user.name` <`git config --get user.email`>" \
+#     ./create_release_files.sh
+#
+##
+
+
+# fail immediately
+set -o errexit
+set -o nounset
+# print command before executing
+set -o xtrace
 
 CURR_DIR=`pwd`
 if [[ `basename $CURR_DIR` != "tools" ]] ; then
@@ -36,92 +60,98 @@ if [[ `basename $CURR_DIR` != "tools" ]] ; then
   exit 1
 fi
 
+##
+## Variables with defaults (if not overwritten by environment)
+##
 GPG_PASSPHRASE=${GPG_PASSPHRASE:-XXX}
 GPG_KEY=${GPG_KEY:-XXX}
+GIT_AUTHOR=${GIT_AUTHOR:-"Your name <you@apache.org>"}
 GIT_BRANCH=${GIT_BRANCH:-branch-1.0}
 OLD_VERSION=${OLD_VERSION:-0.6-incubating-SNAPSHOT}
 RELEASE_VERSION=${NEW_VERSION}
 RELEASE_CANDIDATE=${RELEASE_CANDIDATE:-rc1}
 NEW_VERSION_HADOOP1=${NEW_VERSION_HADOOP1:-"$RELEASE_VERSION-hadoop1"}
-USER_NAME=${USER_NAME:-pwendell}
+USER_NAME=${USER_NAME:-yourapacheidhere}
 MVN=${MVN:-mvn}
 GPG=${GPG:-gpg}
-SHASUM=${SHASUM:-sha512sum}
-MD5SUM=${MD5SUM:-md5sum}
-sonatype_user=${sonatype_user:-rmetzger} #legacy variable name referring to maven
+sonatype_user=${sonatype_user:-yourapacheidhere}
 sonatype_pw=${sonatype_pw:-XXX}
 
-#echo $NEW_VERSION_HADOOP1
-#sleep 5
-#set -e
 
-# create source package
+if [ "$(uname)" == "Darwin" ]; then
+    SHASUM="shasum -a 512"
+    MD5SUM="md5 -r"
+else
+    SHASUM=sha512sum
+    MD5SUM=md5sum
+fi
 
-git clone http://git-wip-us.apache.org/repos/asf/flink.git flink
-cd flink
-git checkout -b "$RELEASE_BRANCH-$RELEASE_CANDIDATE" origin/$RELEASE_BRANCH
-rm .gitignore
-rm .travis.yml
-rm deploysettings.xml
-rm CHANGELOG
-#rm -rf .git
 
-#find . -name 'pom.xml' -type f -exec sed -i 's#<version>$OLD_VERSION</version>#<version>$NEW_VERSION</version>#'
{} \;
-# FOR MAC: find . -name 'pom.xml' -type f -exec sed -i "" 's#<version>'$OLD_VERSION'</version>#<version>'$NEW_VERSION'</version>#'
{} \;
-find . -name 'pom.xml' -type f -exec sed -i 's#<version>'$OLD_VERSION'</version>#<version>'$NEW_VERSION'</version>#'
{} \;
+prepare() {
+  # prepare
+  git clone http://git-wip-us.apache.org/repos/asf/flink.git flink
+  cd flink
+  git checkout -b "$RELEASE_VERSION-$RELEASE_CANDIDATE" origin/$RELEASE_BRANCH
+  rm -f .gitignore
+  rm -f .travis.yml
+  rm -f deploysettings.xml
+  rm -f CHANGELOG
+}
 
-git commit --author="Robert Metzger <rmetzger@apache.org>" -am "Commit for release
$RELEASE_VERSION"
-# sry for hardcoding my name, but this makes releasing even faster
-git remote add asf_push https://$USER_NAME@git-wip-us.apache.org/repos/asf/flink.git
-RELEASE_HASH=`git rev-parse HEAD`
-echo "Echo created release hash $RELEASE_HASH"
+# create source package
+make_source_release() {
 
-cd ..
+  #find . -name 'pom.xml' -type f -exec sed -i 's#<version>$OLD_VERSION</version>#<version>$NEW_VERSION</version>#'
{} \;
+  if [ "$(uname)" == "Darwin" ]; then
+      find . -name 'pom.xml' -type f -exec sed -i "" 's#<version>'$OLD_VERSION'</version>#<version>'$NEW_VERSION'</version>#'
{} \;
+  else
+      find . -name 'pom.xml' -type f -exec sed -i    's#<version>'$OLD_VERSION'</version>#<version>'$NEW_VERSION'</version>#'
{} \;
+  fi
 
+  git commit --author="$GIT_AUTHOR" -am "Commit for release $RELEASE_VERSION"
+  git remote add asf_push https://$USER_NAME@git-wip-us.apache.org/repos/asf/flink.git
+  RELEASE_HASH=`git rev-parse HEAD`
+  echo "Echo created release hash $RELEASE_HASH"
 
-## NOTE: if gpg is not working, follow these instructions:
-# https://wiki.archlinux.org/index.php/GnuPG#Unattended_passphrase
-# info taken from:
-# http://www.reddit.com/r/archlinux/comments/2nmr4a/after_upgrade_to_gpg_210_mutt_and_gpg_no_longer/
+  cd ..
 
-echo "Creating source package"
-cp -r flink flink-$RELEASE_VERSION
-tar cvzf flink-${RELEASE_VERSION}-src.tgz --exclude .git flink-$RELEASE_VERSION
-echo $GPG_PASSPHRASE | $GPG --batch --default-key $GPG_KEY --passphrase-fd 0 --armour --output
flink-$RELEASE_VERSION-src.tgz.asc \
-  --detach-sig flink-$RELEASE_VERSION-src.tgz
-$MD5SUM flink-$RELEASE_VERSION-src.tgz > flink-$RELEASE_VERSION-src.tgz.md5
-$SHASUM flink-$RELEASE_VERSION-src.tgz > flink-$RELEASE_VERSION-src.tgz.sha
-rm -rf flink-$RELEASE_VERSION
+  echo "Creating source package"
+  rsync -a --exclude "flink/.git" flink/ flink-$RELEASE_VERSION
+  tar czf flink-${RELEASE_VERSION}-src.tgz flink-$RELEASE_VERSION
+  echo $GPG_PASSPHRASE | $GPG --batch --default-key $GPG_KEY --passphrase-fd 0 --armour --output
flink-$RELEASE_VERSION-src.tgz.asc \
+    --detach-sig flink-$RELEASE_VERSION-src.tgz
+  $MD5SUM flink-$RELEASE_VERSION-src.tgz > flink-$RELEASE_VERSION-src.tgz.md5
+  $SHASUM flink-$RELEASE_VERSION-src.tgz > flink-$RELEASE_VERSION-src.tgz.sha
+  rm -rf flink-$RELEASE_VERSION
+}
 
 
 make_binary_release() {
   NAME=$1
   FLAGS=$2
   echo "Creating binary release name: $NAME, flags: $FLAGS"
-  cp -r flink flink-$RELEASE_VERSION-bin-$NAME
-  
+  rsync -a --exclude "flink/.git" flink/ flink-$RELEASE_VERSION-bin-$NAME
+
   cd flink-$RELEASE_VERSION-bin-$NAME
   # make distribution
   $MVN clean package $FLAGS -DskipTests
 
   # Check that the uberjar is not too big
-  UBERJAR=`find . | grep flink-dist | head -n 1`
+  UBERJAR=`find flink-dist -name "flink-dist-${RELEASE_VERSION}.jar" | head -n 1`
   if [ -z "$UBERJAR" ] ; then
     echo "Uberjar not found. Assuming failed build";
-  else 
+  else
     jar tf $UBERJAR | wc -l > num_files_in_uberjar
     NUM_FILES_IN_UBERJAR=`cat num_files_in_uberjar`
     echo "Files in uberjar: $NUM_FILES_IN_UBERJAR. Uberjar: $UBERJAR"
     if [ "$NUM_FILES_IN_UBERJAR" -ge "65536" ] ; then
       echo "The number of files in the uberjar ($NUM_FILES_IN_UBERJAR) exceeds the maximum
number of possible files for Java 6 (65536)"
-      exit 1
+    #  exit 1
     fi
   fi
   cd flink-dist/target/flink-$RELEASE_VERSION-bin/
-  tar cvzf flink-$RELEASE_VERSION-bin-$NAME.tgz flink-$RELEASE_VERSION
-  if [ -d "flink-yarn-$RELEASE_VERSION" ] ; then
-    tar cvzf flink-$RELEASE_VERSION-bin-$NAME-yarn.tgz flink-yarn-$RELEASE_VERSION
-  fi
+  tar czf flink-$RELEASE_VERSION-bin-$NAME.tgz flink-$RELEASE_VERSION
+
   cp flink-*.tgz ../../../../
   cd ../../../../
   rm -rf flink-$RELEASE_VERSION
@@ -134,37 +164,47 @@ make_binary_release() {
   $MD5SUM flink-$RELEASE_VERSION-bin-$NAME.tgz > flink-$RELEASE_VERSION-bin-$NAME.tgz.md5
   $SHASUM flink-$RELEASE_VERSION-bin-$NAME.tgz > flink-$RELEASE_VERSION-bin-$NAME.tgz.sha
 
-  if [ -f "flink-$RELEASE_VERSION-bin-$NAME-yarn.tgz" ] ; then
-    echo $GPG_PASSPHRASE | $GPG --batch --default-key $GPG_KEY \
-    --passphrase-fd 0 --armour \
-    --output flink-$RELEASE_VERSION-bin-$NAME-yarn.tgz.asc \
-    --detach-sig flink-$RELEASE_VERSION-bin-$NAME-yarn.tgz
-    $MD5SUM flink-$RELEASE_VERSION-bin-$NAME-yarn.tgz > flink-$RELEASE_VERSION-bin-$NAME-yarn.tgz.md5
-    $SHASUM flink-$RELEASE_VERSION-bin-$NAME-yarn.tgz > flink-$RELEASE_VERSION-bin-$NAME-yarn.tgz.sha
-  fi
 }
 
+deploy_to_maven() {
+  echo "Deploying to repository.apache.org"
+
+  cd flink
+  cp ../../deploysettings.xml .
+  echo "For your reference, the command:\n\t $MVN clean deploy -Prelease --settings deploysettings.xml
-DskipTests -Dgpg.keyname=$GPG_KEY -Dgpg.passphrase=$GPG_PASSPHRASE ./tools/generate_specific_pom.sh
$NEW_VERSION $NEW_VERSION_HADOOP1 pom.xml"
+  $MVN clean deploy -Prelease,docs-and-source --settings deploysettings.xml -DskipTests -Dgpg.executable=$GPG
-Dgpg.keyname=$GPG_KEY -Dgpg.passphrase=$GPG_PASSPHRASE -DretryFailedDeploymentCount=10
+  ../generate_specific_pom.sh $NEW_VERSION $NEW_VERSION_HADOOP1 pom.xml
+  sleep 4
+  $MVN clean deploy -Dgpg.executable=$GPG -Prelease,docs-and-source --settings deploysettings.xml
-DskipTests -Dgpg.keyname=$GPG_KEY -Dgpg.passphrase=$GPG_PASSPHRASE -DretryFailedDeploymentCount=10
+}
+
+copy_data() {
+  # Copy data
+  echo "Copying release tarballs"
+  folder=flink-$RELEASE_VERSION-$RELEASE_CANDIDATE
+  ssh $USER_NAME@people.apache.org mkdir -p /home/$USER_NAME/public_html/$folder
+  rsync flink-*.tgz* $USER_NAME@people.apache.org:/home/$USER_NAME/public_html/$folder/
+  echo "copy done"
+}
+
+prepare
+
+make_source_release
+
 make_binary_release "hadoop1" "-Dhadoop.profile=1"
-make_binary_release "hadoop200alpha" "-P!include-yarn -Dhadoop.version=2.0.0-alpha"
+#make_binary_release "hadoop200alpha" "-P!include-yarn -Dhadoop.version=2.0.0-alpha"
 make_binary_release "hadoop2" ""
+make_binary_release "hadoop24" "-Dhadoop.version=2.4.1"
+make_binary_release "hadoop26" "-Dhadoop.version=2.6.0"
+make_binary_release "hadoop27" "-Dhadoop.version=2.7.0"
 # make_binary_release "mapr4" "-Dhadoop.profile=2 -Pvendor-repos -Dhadoop.version=2.3.0-mapr-4.0.0-FCS"
 
+copy_data
+
+deploy_to_maven
+
 
-# Copy data
-echo "Copying release tarballs"
-folder=flink-$RELEASE_VERSION-$RELEASE_CANDIDATE
-ssh $USER_NAME@people.apache.org mkdir -p /home/$USER_NAME/public_html/$folder
-scp flink-* $USER_NAME@people.apache.org:/home/$USER_NAME/public_html/$folder/
-echo "copy done"
 
-echo "Deploying to repository.apache.org"
 
-cd flink
-cp ../../deploysettings.xml . 
-echo "For your reference, the command:\n\t $MVN clean deploy -Prelease --settings deploysettings.xml
-DskipTests -Dgpg.keyname=$GPG_KEY -Dgpg.passphrase=$GPG_PASSPHRASE ./tools/generate_specific_pom.sh
$NEW_VERSION $NEW_VERSION_HADOOP1 pom.xml"
-$MVN clean deploy -Prelease,docs-and-source --settings deploysettings.xml -DskipTests -Dgpg.executable=$GPG
-Dgpg.keyname=$GPG_KEY -Dgpg.passphrase=$GPG_PASSPHRASE -DretryFailedDeploymentCount=10
-../generate_specific_pom.sh $NEW_VERSION $NEW_VERSION_HADOOP1 pom.xml
-sleep 4
-$MVN clean deploy -Dgpg.executable=$GPG -Prelease,docs-and-source --settings deploysettings.xml
-DskipTests -Dgpg.keyname=$GPG_KEY -Dgpg.passphrase=$GPG_PASSPHRASE -DretryFailedDeploymentCount=10
 
 echo "Done. Don't forget to commit the release version"


Mime
View raw message