parquet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ziva...@apache.org
Subject [parquet-mr] branch master updated: PARQUET-1490: Add branch-specific Travis steps (#590)
Date Fri, 11 Jan 2019 12:54:47 GMT
This is an automated email from the ASF dual-hosted git repository.

zivanfi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/parquet-mr.git


The following commit(s) were added to refs/heads/master by this push:
     new 3d8eae7  PARQUET-1490: Add branch-specific Travis steps (#590)
3d8eae7 is described below

commit 3d8eae78291ace9d9a12839a932c52a785b0b308
Author: Zoltan Ivanfi <zivanfi@apache.org>
AuthorDate: Fri Jan 11 13:54:42 2019 +0100

    PARQUET-1490: Add branch-specific Travis steps (#590)
    
    The possiblity of branch-specific scripts allows feature branches to build
    SNAPSHOT versions of parquet-format (and depend on them in the POM files). Even
    if such branch-specific scripts get merged into master accidentally, they will
    not have any effect there.
    
    The script for the main branch checks the POM files to make sure that SNAPSHOT
    dependencies are not added to or merged into master accidentally.
---
 .travis.yml                         | 30 +-------------------
 dev/travis-before_install-master.sh | 50 +++++++++++++++++++++++++++++++++
 dev/travis-before_install.sh        | 55 +++++++++++++++++++++++++++++++++++++
 3 files changed, 106 insertions(+), 29 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index e4e623f..d33051f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,34 +1,6 @@
 language: java
 before_install:
-  - date
-  - sudo apt-get update -qq
-  - sudo apt-get install build-essential
-  - sudo apt-get install pv
-  - date
-  - mkdir protobuf_install
-  - pushd protobuf_install
-  - wget https://github.com/google/protobuf/archive/v3.5.1.tar.gz -O protobuf-3.5.1.tar.gz
-  - tar xzf protobuf-3.5.1.tar.gz
-  - cd protobuf-3.5.1
-  - sudo apt-get install autoconf automake libtool curl make g++ unzip
-  - ./autogen.sh
-  - ./configure
-  - make
-  - sudo make install
-  - sudo ldconfig
-  - protoc --version
-  - popd
-  - date
-  - pwd
-  - sudo apt-get install -qq libboost-dev libboost-test-dev libboost-program-options-dev
libevent-dev automake libtool flex bison pkg-config g++ libssl-dev
-  - wget -nv http://archive.apache.org/dist/thrift/0.9.3/thrift-0.9.3.tar.gz
-  - tar zxf thrift-0.9.3.tar.gz
-  - cd thrift-0.9.3
-  - chmod +x ./configure
-  - ./configure --disable-gen-erl --disable-gen-hs --without-ruby --without-haskell --without-erlang
--without-php --without-nodejs
-  - sudo make install
-  - cd ..
-  - date
+  - bash dev/travis-before_install.sh
 
 env:
   - HADOOP_PROFILE=default TEST_CODECS=uncompressed,brotli
diff --git a/dev/travis-before_install-master.sh b/dev/travis-before_install-master.sh
new file mode 100644
index 0000000..2c865ce
--- /dev/null
+++ b/dev/travis-before_install-master.sh
@@ -0,0 +1,50 @@
+# 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.
+
+################################################################################
+# This is a branch-specific script that gets invoked at the end of
+# travis-before_install.sh. It is run for the master branch only.
+################################################################################
+
+fail_the_build=
+reduced_pom="$(tempfile)"
+shopt -s globstar # Enables ** to match files in subdirectories recursively
+for pom in **/pom.xml
+do
+  # Removes the project/version and project/parent/version elements, because
+  # those are allowed to have SNAPSHOT in them. Also removes comments.
+  xmlstarlet ed -N pom='http://maven.apache.org/POM/4.0.0' \
+             -d '/pom:project/pom:version|/pom:project/pom:parent/pom:version|//comment()'
"$pom" > "$reduced_pom"
+  if grep -q SNAPSHOT "$reduced_pom"
+  then
+    if [[ ! "$fail_the_build" ]]
+    then
+      printf "Error: POM files in the master branch can not refer to SNAPSHOT versions.\n"
+      fail_the_build=YES
+    fi
+    printf "\nOffending POM file: %s\nOffending content:\n" "$pom"
+    # Removes every element that does not have SNAPSHOT in it or its
+    # descendants. As a result, we get a skeleton of the POM file with only the
+    # offending parts.
+    xmlstarlet ed -d "//*[count((.|.//*)[contains(text(), 'SNAPSHOT')]) = 0]" "$reduced_pom"
+  fi
+done
+rm "$reduced_pom"
+if [[ "$fail_the_build" ]]
+then
+   exit 1
+fi
diff --git a/dev/travis-before_install.sh b/dev/travis-before_install.sh
new file mode 100644
index 0000000..6d04279
--- /dev/null
+++ b/dev/travis-before_install.sh
@@ -0,0 +1,55 @@
+# 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.
+
+################################################################################
+# This script gets invoked by .travis.yml in the before_install step
+################################################################################
+
+set -e
+date
+sudo apt-get update -qq
+sudo apt-get install -qq build-essential pv autoconf automake libtool curl make \
+   g++ unzip libboost-dev libboost-test-dev libboost-program-options-dev \
+   libevent-dev automake libtool flex bison pkg-config g++ libssl-dev xmlstarlet
+date
+mkdir protobuf_install
+pushd protobuf_install
+wget https://github.com/google/protobuf/archive/v3.5.1.tar.gz -O protobuf-3.5.1.tar.gz
+tar xzf protobuf-3.5.1.tar.gz
+cd protobuf-3.5.1
+./autogen.sh
+./configure
+make
+sudo make install
+sudo ldconfig
+protoc --version
+popd
+date
+pwd
+wget -nv http://archive.apache.org/dist/thrift/0.9.3/thrift-0.9.3.tar.gz
+tar zxf thrift-0.9.3.tar.gz
+cd thrift-0.9.3
+chmod +x ./configure
+./configure --disable-gen-erl --disable-gen-hs --without-ruby --without-haskell --without-erlang
--without-php --without-nodejs
+sudo make install
+cd ..
+branch_specific_script="dev/travis-before_install-${TRAVIS_BRANCH}.sh"
+if [[ -e "$branch_specific_script" ]]
+then
+  . "$branch_specific_script"
+fi
+date


Mime
View raw message