flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aljos...@apache.org
Subject [1/3] flink git commit: [FLINK-7290] Add modular release scripts
Date Fri, 28 Jul 2017 16:04:15 GMT
Repository: flink
Updated Branches:
  refs/heads/release-1.3 452f5d103 -> 084c59e0e


[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/084c59e0
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/084c59e0
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/084c59e0

Branch: refs/heads/release-1.3
Commit: 084c59e0ec7b0800d2612b23e702a9064fe66aac
Parents: b5c9617
Author: Aljoscha Krettek <aljoscha.krettek@gmail.com>
Authored: Thu Jul 27 15:07:44 2017 +0200
Committer: Aljoscha Krettek <aljoscha.krettek@gmail.com>
Committed: Fri Jul 28 16:51:13 2017 +0200

----------------------------------------------------------------------
 tools/releasing/create_binary_release.sh | 104 ++++++++++++++++++++++++++
 tools/releasing/create_release_branch.sh |  65 ++++++++++++++++
 tools/releasing/create_source_release.sh |  63 ++++++++++++++++
 tools/releasing/deploy_staging_jars.sh   |  54 +++++++++++++
 4 files changed, 286 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/084c59e0/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..7971d8c
--- /dev/null
+++ b/tools/releasing/create_binary_release.sh
@@ -0,0 +1,104 @@
+#!/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}"
+
+  ./tools/change-scala-version.sh ${SCALA_VERSION}
+
+  # enable release profile here (to check for the maven version)
+  $MVN clean package $FLAGS -DskipTests -Prelease -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/084c59e0/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..673c45b
--- /dev/null
+++ b/tools/releasing/create_release_branch.sh
@@ -0,0 +1,65 @@
+#!/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
+perl -pi -e "s#^version_short: .*#version_short: \"${NEW_VERSION}\"#" _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/084c59e0/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/084c59e0/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..96ef638
--- /dev/null
+++ b/tools/releasing/deploy_staging_jars.sh
@@ -0,0 +1,54 @@
+#!/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"
+cd tools && ./change-scala-version.sh 2.11 && cd ..
+
+$MVN clean deploy -Prelease,docs-and-source -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"
+cd tools && ./change-scala-version.sh 2.10 && cd ..
+
+$MVN clean deploy -Prelease,docs-and-source -DskipTests -DretryFailedDeploymentCount=10


Mime
View raw message