Repository: parquet-cpp Updated Branches: refs/heads/master 1acd49d18 -> 3fa46d121
PARQUET-773: Check licenses with RAT in CI Author: Uwe L. Korn <[email protected]> Closes #189 from xhochy/PARQUET-773 and squashes the following commits: fbf4899 [Uwe L. Korn] Correct the path to RAT 1328559 [Uwe L. Korn] Add remote to archive the correct git 650b6c0 [Uwe L. Korn] Show bash commands ce3f7ce [Uwe L. Korn] PARQUET-773: Check licenses with RAT in CI Project: http://git-wip-us.apache.org/repos/asf/parquet-cpp/repo Commit: http://git-wip-us.apache.org/repos/asf/parquet-cpp/commit/3fa46d12 Tree: http://git-wip-us.apache.org/repos/asf/parquet-cpp/tree/3fa46d12 Diff: http://git-wip-us.apache.org/repos/asf/parquet-cpp/diff/3fa46d12 Branch: refs/heads/master Commit: 3fa46d1219c6f8a1f9104572e554f7e739a96b87 Parents: 1acd49d Author: Uwe L. Korn <[email protected]> Authored: Wed Nov 9 10:13:00 2016 -0500 Committer: Wes McKinney <[email protected]> Committed: Wed Nov 9 10:13:00 2016 -0500 ---------------------------------------------------------------------- ci/travis_script_cpp.sh | 6 +++++- dev/release/run-rat.sh | 45 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/3fa46d12/ci/travis_script_cpp.sh ---------------------------------------------------------------------- diff --git a/ci/travis_script_cpp.sh b/ci/travis_script_cpp.sh index c8d9b40..3cd64eb 100755 --- a/ci/travis_script_cpp.sh +++ b/ci/travis_script_cpp.sh @@ -12,10 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. See accompanying LICENSE file. -set -e +set -xe : ${CPP_BUILD_DIR=$TRAVIS_BUILD_DIR/parquet-build} +# Check licenses according to Apache policy +git archive HEAD -o parquet-cpp-src.tar.gz "--remote=file://$TRAVIS_BUILD_DIR" +$TRAVIS_BUILD_DIR/dev/release/run-rat.sh parquet-cpp-src.tar.gz + pushd $CPP_BUILD_DIR make lint http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/3fa46d12/dev/release/run-rat.sh ---------------------------------------------------------------------- diff --git a/dev/release/run-rat.sh b/dev/release/run-rat.sh new file mode 100755 index 0000000..f9ad1a3 --- /dev/null +++ b/dev/release/run-rat.sh @@ -0,0 +1,45 @@ +#!/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. +# + +# download apache rat +curl -s https://repo1.maven.org/maven2/org/apache/rat/apache-rat/0.12/apache-rat-0.12.jar > apache-rat-0.12.jar + +RAT="java -jar apache-rat-0.12.jar -d " + +# generate the rat report +$RAT $1 \ + -e ".*" \ + -e mman.h \ + -e "*_generated.h" \ + -e asan_symbolize.py \ + -e cpplint.py \ + -e pax_global_header \ + > rat.txt +cat rat.txt +UNAPPROVED=`cat rat.txt | grep "Unknown Licenses" | head -n 1 | cut -d " " -f 1` + +if [ "0" -eq "${UNAPPROVED}" ]; then + echo "No unnaproved licenses" +else + echo "${UNAPPROVED} unapproved licences. Check rat report: rat.txt" + exit 1 +fi + +
