You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by al...@apache.org on 2017/07/28 19:38:44 UTC

[3/3] flink git commit: [FLINK-7290] Add modular release scripts

[FLINK-7290] Add modular release scripts


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

Branch: refs/heads/master
Commit: 18733d82e694997e229afb50f13c21fcc1c65729
Parents: f1c92f2
Author: Aljoscha Krettek <al...@gmail.com>
Authored: Thu Jul 27 15:07:44 2017 +0200
Committer: Aljoscha Krettek <al...@gmail.com>
Committed: Fri Jul 28 21:36:24 2017 +0200

----------------------------------------------------------------------
 tools/releasing/create_binary_release.sh | 102 ++++++++++++++++++++++++++
 tools/releasing/create_release_branch.sh |  69 +++++++++++++++++
 tools/releasing/create_source_release.sh |  63 ++++++++++++++++
 tools/releasing/deploy_staging_jars.sh   |  51 +++++++++++++
 4 files changed, 285 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/18733d82/tools/releasing/create_binary_release.sh
----------------------------------------------------------------------
diff --git a/tools/releasing/create_binary_release.sh b/tools/releasing/create_binary_release.sh
new file mode 100755
index 0000000..77715e5
--- /dev/null
+++ b/tools/releasing/create_binary_release.sh
@@ -0,0 +1,102 @@
+#!/usr/bin/env bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##
+## Variables with defaults (if not overwritten by environment)
+##
+RELEASE_VERSION=${RELEASE_VERSION:-1.3-SNAPSHOT}
+SCALA_VERSION=none
+HADOOP_VERSION=none
+SKIP_GPG=${SKIP_GPG:-false}
+MVN=${MVN:-mvn}
+
+# fail immediately
+set -o errexit
+set -o nounset
+# print command before executing
+set -o xtrace
+
+CURR_DIR=`pwd`
+if [[ `basename $CURR_DIR` != "tools" ]] ; then
+  echo "You have to call the script from the tools/ dir"
+  exit 1
+fi
+
+if [ "$(uname)" == "Darwin" ]; then
+    SHASUM="shasum -a 512"
+    MD5SUM="md5 -r"
+else
+    SHASUM="sha512sum"
+    MD5SUM="md5sum"
+fi
+
+###########################
+
+# build maven package, create Flink distribution, generate signature
+make_binary_release() {
+  NAME=$1
+  FLAGS=$2
+  SCALA_VERSION=$3
+
+  echo "Creating binary release name: $NAME, flags: $FLAGS, SCALA_VERSION: ${SCALA_VERSION}"
+  dir_name="flink-$RELEASE_VERSION-bin-$NAME-scala_${SCALA_VERSION}"
+
+  # enable release profile here (to check for the maven version)
+  $MVN clean package $FLAGS -DskipTests -Prelease,scala-${SCALA_VERSION} -Dgpg.skip
+
+  cd flink-dist/target/flink-*-bin/
+  tar czf "${dir_name}.tgz" flink-*
+
+  cp flink-*.tgz ../../../
+  cd ../../../
+
+  # Sign md5 and sha the tgz
+  if [ "$SKIP_GPG" == "false" ] ; then
+    gpg --armor --detach-sig "${dir_name}.tgz"
+  fi
+  $MD5SUM "${dir_name}.tgz" > "${dir_name}.tgz.md5"
+  $SHASUM "${dir_name}.tgz" > "${dir_name}.tgz.sha"
+}
+
+cd ..
+
+
+if [ "$SCALA_VERSION" == "none" ] && [ "$HADOOP_VERSION" == "none" ]; then
+  make_binary_release "hadoop2" "" 2.10
+  make_binary_release "hadoop24" "-Dhadoop.version=2.4.1" "2.10"
+  make_binary_release "hadoop26" "-Dhadoop.version=2.6.3" "2.10"
+  make_binary_release "hadoop27" "-Dhadoop.version=2.7.2" "2.10"
+
+  make_binary_release "hadoop2" "" 2.11
+  make_binary_release "hadoop24" "-Dhadoop.version=2.4.1" "2.11"
+  make_binary_release "hadoop26" "-Dhadoop.version=2.6.3" "2.11"
+  make_binary_release "hadoop27" "-Dhadoop.version=2.7.2" "2.11"
+elif [ "$SCALA_VERSION" == none ] && [ "$HADOOP_VERSION" != "none" ]
+then
+  make_binary_release "hadoop2" "-Dhadoop.version=$HADOOP_VERSION" "2.10"
+  make_binary_release "hadoop2" "-Dhadoop.version=$HADOOP_VERSION" "2.11"
+elif [ "$SCALA_VERSION" != none ] && [ "$HADOOP_VERSION" == "none" ]
+then
+  make_binary_release "hadoop2" "" $SCALA_VERSION
+  make_binary_release "hadoop24" "-Dhadoop.version=2.4.1" "$SCALA_VERSION"
+  make_binary_release "hadoop26" "-Dhadoop.version=2.6.3" "$SCALA_VERSION"
+  make_binary_release "hadoop27" "-Dhadoop.version=2.7.2" "$SCALA_VERSION"
+else
+  make_binary_release "hadoop2x" "-Dhadoop.version=$HADOOP_VERSION" "$SCALA_VERSION"
+fi

http://git-wip-us.apache.org/repos/asf/flink/blob/18733d82/tools/releasing/create_release_branch.sh
----------------------------------------------------------------------
diff --git a/tools/releasing/create_release_branch.sh b/tools/releasing/create_release_branch.sh
new file mode 100755
index 0000000..c2bca88
--- /dev/null
+++ b/tools/releasing/create_release_branch.sh
@@ -0,0 +1,69 @@
+#!/usr/bin/env bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##
+## Variables with defaults (if not overwritten by environment)
+##
+OLD_VERSION=${OLD_VERSION:-1.2-SNAPSHOT}
+NEW_VERSION=${NEW_VERSION:-1.3-SNAPSHOT}
+RELEASE_CANDIDATE=${RELEASE_CANDIDATE:-none}
+MVN=${MVN:-mvn}
+
+# fail immediately
+set -o errexit
+set -o nounset
+# print command before executing
+set -o xtrace
+
+CURR_DIR=`pwd`
+if [[ `basename $CURR_DIR` != "tools" ]] ; then
+  echo "You have to call the script from the tools/ dir"
+  exit 1
+fi
+
+###########################
+
+cd ..
+
+target_branch=release-$NEW_VERSION
+if [ "$RELEASE_CANDIDATE" != "none" ]; then
+  target_branch=$target_branch-$RELEASE_CANDIDATE
+fi
+
+git checkout -b $target_branch
+
+#change version in all pom files
+find . -name 'pom.xml' -type f -exec perl -pi -e 's#<version>'$OLD_VERSION'</version>#<version>'$NEW_VERSION'</version>#' {} \;
+
+#change version of documentation
+cd docs
+perl -pi -e "s#^version: .*#version: \"${NEW_VERSION}\"#" _config.yml
+
+# The version in the title should not contain the bugfix version (e.g. 1.3)
+VERSION_TITLE=$(echo $NEW_VERSION | sed 's/\.[^.]*$//')
+perl -pi -e "s#^version_title: .*#version_title: ${VERSION_TITLE}#" _config.yml
+perl -pi -e "s#^version_javadocs: .*#version_javadocs: ${VERSION_TITLE}#" _config.yml
+cd ..
+
+git commit -am "Commit for release $NEW_VERSION"
+
+RELEASE_HASH=`git rev-parse HEAD`
+echo "Echo created release hash $RELEASE_HASH"
+
+echo "Done. Don't forget to create the signed release tag at the end and push the changes."

http://git-wip-us.apache.org/repos/asf/flink/blob/18733d82/tools/releasing/create_source_release.sh
----------------------------------------------------------------------
diff --git a/tools/releasing/create_source_release.sh b/tools/releasing/create_source_release.sh
new file mode 100755
index 0000000..2b29527
--- /dev/null
+++ b/tools/releasing/create_source_release.sh
@@ -0,0 +1,63 @@
+#!/usr/bin/env bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##
+## Variables with defaults (if not overwritten by environment)
+##
+RELEASE_VERSION=${RELEASE_VERSION:-1.3-SNAPSHOT}
+MVN=${MVN:-mvn}
+
+# fail immediately
+set -o errexit
+set -o nounset
+# print command before executing
+set -o xtrace
+
+CURR_DIR=`pwd`
+if [[ `basename $CURR_DIR` != "tools" ]] ; then
+  echo "You have to call the script from the tools/ dir"
+  exit 1
+fi
+
+if [ "$(uname)" == "Darwin" ]; then
+    SHASUM="shasum -a 512"
+    MD5SUM="md5 -r"
+else
+    SHASUM="sha512sum"
+    MD5SUM="md5sum"
+fi
+
+###########################
+
+cd ..
+
+echo "Creating source package"
+
+rsync -a \
+  --exclude ".git" --exclude ".gitignore" --exclude ".gitattributes" --exclude ".travis.yml" \
+  --exclude "deploysettings.xml" --exclude "CHANGELOG" --exclude ".github" --exclude "target" \
+  --exclude ".idea" --exclude "*.iml" --exclude ".DS_Store" --exclude "build-target" \
+  . flink-$RELEASE_VERSION
+
+tar czf flink-${RELEASE_VERSION}-src.tgz flink-$RELEASE_VERSION
+gpg --armor --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

http://git-wip-us.apache.org/repos/asf/flink/blob/18733d82/tools/releasing/deploy_staging_jars.sh
----------------------------------------------------------------------
diff --git a/tools/releasing/deploy_staging_jars.sh b/tools/releasing/deploy_staging_jars.sh
new file mode 100755
index 0000000..a379f8f
--- /dev/null
+++ b/tools/releasing/deploy_staging_jars.sh
@@ -0,0 +1,51 @@
+#!/usr/bin/env bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##
+## Variables with defaults (if not overwritten by environment)
+##
+MVN=${MVN:-mvn}
+
+# fail immediately
+set -o errexit
+set -o nounset
+# print command before executing
+set -o xtrace
+
+CURR_DIR=`pwd`
+if [[ `basename $CURR_DIR` != "tools" ]] ; then
+  echo "You have to call the script from the tools/ dir"
+  exit 1
+fi
+
+###########################
+
+cd ..
+
+echo "Deploying to repository.apache.org"
+
+echo "Deploying Scala 2.11 version"
+$MVN clean deploy -Prelease,docs-and-source,scala-2.11 -DskipTests -DretryFailedDeploymentCount=10
+
+# It is important to first deploy scala 2.11 and then scala 2.10 so that the quickstarts (which are independent of the scala version)
+# are depending on scala 2.10.
+
+echo "Deploying Scala 2.10 version"
+$MVN clean deploy -Prelease,docs-and-source,scala-2.10 -DskipTests -DretryFailedDeploymentCount=10
+