sijie closed pull request #1224: Improve Travis Build
URL: https://github.com/apache/bookkeeper/pull/1224
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/.travis.yml b/.travis.yml
index 156a0ba9c..d21823923 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -38,7 +38,7 @@ matrix:
       dist: trusty
       env: CUSTOM_JDK="openjdk8"
 
-before_install:
+before_install: 
 - |
     echo "MAVEN_OPTS='-Xmx3072m -XX:MaxPermSize=512m'" > ~/.mavenrc
     if [ "$TRAVIS_OS_NAME" == "osx" ]; then
@@ -54,38 +54,18 @@ before_install:
     else
         if [ `git diff --name-only $TRAVIS_COMMIT_RANGE | grep 
"^stream\/distributedlog" | wc -l` -gt 0 ]; then
             export DLOG_MODIFIED="true"  
-            echo "Enable testing distributedlog modules if this pull request 
modifies files under directory `stream/distributedlog`."
+            echo "Enable testing distributedlog modules if this pull request 
modifies files under directory 'stream/distributedlog'."
         fi
         if [ `git diff --name-only $TRAVIS_COMMIT_RANGE | grep "^site\/" | wc 
-l` -gt 0 ]; then
             # building the website to ensure the changes don't break
             export WEBSITE_MODIFIED="true"
-            echo "Enable building website modules if this pull request 
modifies files under directory `site`."
+            echo "Enable building website modules if this pull request 
modifies files under directory 'site'."
         fi
     fi
 
-script:
-- |
-    set -e
-    mvn --batch-mode clean apache-rat:check compile spotbugs:check install 
-DskipTests
-    if [ "$TRAVIS_OS_NAME" == "linux" ]; then
-        dev/check-binary-license 
./bookkeeper-dist/all/target/bookkeeper-all-*-bin.tar.gz;
-        dev/check-binary-license 
./bookkeeper-dist/server/target/bookkeeper-server-*-bin.tar.gz;
-    fi
-    if [ "$DLOG_MODIFIED" == "true" ]; then
-        cd stream/distributedlog
-        travis_wait 60 mvn --batch-mode clean package -Ddistributedlog
-        cd ../..
-    fi
-    if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$WEBSITE_MODIFIED" == "true" ]; 
then
-        cd site
-        make clean
-        # run the docker image to build the website
-        ./docker/ci.sh
-        cd ..
-    fi
+install: true
 
-# Disabled the tests here. Since tests are running much slower on Travis than 
on Jenkins
-#  - ./dev/ticktoc.sh "mvn --batch-mode clean package"
+script: .travis_scripts/build.sh
 
 cache:
   directories:
diff --git a/.travis_scripts/build.sh b/.travis_scripts/build.sh
new file mode 100755
index 000000000..d97102633
--- /dev/null
+++ b/.travis_scripts/build.sh
@@ -0,0 +1,39 @@
+#!/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.
+#
+
+set -ev
+
+BINDIR=`dirname "$0"`
+BK_HOME=`cd $BINDIR/..;pwd`
+
+mvn --batch-mode clean apache-rat:check compile spotbugs:check install 
-DskipTests
+if [ "$TRAVIS_OS_NAME" == "linux" ]; then
+    $BK_HOME/dev/check-binary-license 
./bookkeeper-dist/all/target/bookkeeper-all-*-bin.tar.gz;
+    $BK_HOME/dev/check-binary-license 
./bookkeeper-dist/server/target/bookkeeper-server-*-bin.tar.gz;
+fi
+if [ "$DLOG_MODIFIED" == "true" ]; then
+    cd $BK_HOME/stream/distributedlog
+    mvn --batch-mode clean package -Ddistributedlog
+fi
+if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$WEBSITE_MODIFIED" == "true" ]; then
+    cd $BK_HOME/site
+    make clean
+    # run the docker image to build the website
+    ./docker/ci.sh
+fi
diff --git a/site/README.md b/site/README.md
index 469ad27e1..3942932e3 100644
--- a/site/README.md
+++ b/site/README.md
@@ -57,3 +57,4 @@ Here are a few steps to follow to stage your changes:
 6. Your changes will be live on 
`https://<your-github-id>.github.io/bookkeeper-staging-site`.
 
 If you have any ideas to improve the review process for website, please feel 
free to contact us at d...@bookkeeper.apache.org.
+
diff --git a/stream/distributedlog/core/bin/dlog 
b/stream/distributedlog/core/bin/dlog
index 2b6af7eac..01f8ee344 100755
--- a/stream/distributedlog/core/bin/dlog
+++ b/stream/distributedlog/core/bin/dlog
@@ -70,3 +70,4 @@ case "${COMMAND}" in
     exec java $OPTS $COMMAND $@
     ;;
 esac
+


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to