You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by ni...@apache.org on 2019/12/23 03:14:18 UTC
[kylin] 05/30: KYLIN-3852 Provide Flink binary package download
script
This is an automated email from the ASF dual-hosted git repository.
nic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git
commit 034a1dcd42862b0e6ff2d773d44d936cf3c5d00e
Author: yanghua <ya...@gmail.com>
AuthorDate: Thu Mar 14 18:59:34 2019 +0800
KYLIN-3852 Provide Flink binary package download script
---
build/script/download-flink.sh | 52 ++++++++++++++++++++++++++++++++++++++++++
build/script/package.sh | 2 ++
2 files changed, 54 insertions(+)
diff --git a/build/script/download-flink.sh b/build/script/download-flink.sh
new file mode 100644
index 0000000..af00236
--- /dev/null
+++ b/build/script/download-flink.sh
@@ -0,0 +1,52 @@
+#!/bin/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.
+#
+
+dir=$(dirname ${0})
+cd ${dir}/../..
+
+rm -rf build/flink
+
+alias md5cmd="md5sum"
+if [[ `uname -a` =~ "Darwin" ]]; then
+ alias md5cmd="md5 -q"
+fi
+
+flink_version="1.7.2"
+scala_version="2.11"
+flink_pkg_md5="e0b5ce7f6352009c74b6c369f5872a5a"
+
+if [ ! -f "build/flink-${flink_version}-bin-hadoop27-scala_${scala_version}.tgz" ]; then
+ echo "no binary file found"
+ wget --directory-prefix=build/ http://archive.apache.org/dist/flink/flink-${flink_version}/flink-${flink_version}-bin-hadoop27-scala_${scala_version}.tgz || echo "Download flink failed"
+else
+ if [ `md5cmd build/ | awk '{print $1}'` != "${flink_pkg_md5}" ]; then
+ echo "md5 check failed"
+ rm build/flink-${flink_version}-bin-hadoop27-scala_${scala_version}.tgz
+ wget --directory-prefix=build/ http://archive.apache.org/dist/flink/flink-${flink_version}/flink-${flink_version}-bin-hadoop27-scala_${scala_version}.tgz || echo "Download flink failed"
+ fi
+fi
+unalias md5cmd
+
+tar -zxvf build/flink-${flink_version}-bin-hadoop27-scala_${scala_version}.tgz -C build/ || { exit 1; }
+mv build/flink-${flink_version} build/flink
+
+# Remove unused components in Flink
+rm -f build/flink/lib/flink-python*
+rm -rf build/flink/examples
+rm -rf build/flink/opt
\ No newline at end of file
diff --git a/build/script/package.sh b/build/script/package.sh
index ef3c277..3d8f9d7 100755
--- a/build/script/package.sh
+++ b/build/script/package.sh
@@ -77,5 +77,7 @@ git rev-parse HEAD >> build/commit_SHA1
sh build/script/build.sh $@ || { exit 1; }
sh build/script/download-tomcat.sh || { exit 1; }
+sh build/script/download-spark.sh || { exit 1; }
+sh build/script/download-flink.sh || { exit 1; }
sh build/script/prepare.sh || { exit 1; }
sh build/script/compress.sh || { exit 1; }