You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by mo...@apache.org on 2017/03/22 23:17:21 UTC

zeppelin git commit: [ZEPPELIN-2230] .travis.yml protecting against ambiguous commit range

Repository: zeppelin
Updated Branches:
  refs/heads/master 4a51028e9 -> 405cb44cf


[ZEPPELIN-2230] .travis.yml protecting against ambiguous commit range

### What is this PR for?
Following the revert of [#2111](https://github.com/apache/zeppelin/pull/2111
) I added some protection in case TRAVIS_COMMIT_RANGE is "ambiguous" i.e. some paths or commits are not found within the range. (can happen on some push --force).

### What type of PR is it?
Bug Fix

### Todos
* [ ] - Task

### What is the Jira issue?
[ZEPPELIN-2230](https://issues.apache.org/jira/browse/ZEPPELIN-2230)

### How should this be tested?
Re-do a twisted git push --force.

### Screenshots (if appropriate)

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Author: Remilito <re...@gmail.com>

Closes #2167 from Remilito/ZEPPELIN-2230b and squashes the following commits:

97968f9 [Remilito] Protecting against ambiguous TRAVIS_COMMIT_RANGE. E.g.: when push force, some commits might be missing from the origin branch, therefore causing an unsusable COMMIT_RANGE.
cb9647f [Remilito] [ZEPPELIN-2230] clear bower_contents if bower.json changed or bower clear provided in commit message


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/405cb44c
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/405cb44c
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/405cb44c

Branch: refs/heads/master
Commit: 405cb44cf1b13d0fe6b8d4a64d28bf0faf7606d4
Parents: 4a51028
Author: Remilito <re...@gmail.com>
Authored: Mon Mar 20 11:32:59 2017 +0100
Committer: Lee moon soo <mo...@apache.org>
Committed: Wed Mar 22 16:17:16 2017 -0700

----------------------------------------------------------------------
 .travis.yml | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/405cb44c/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 45ed079..ee51c75 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -25,6 +25,7 @@ cache:
     - ${HOME}/R
     -  zeppelin-web/node
     -  zeppelin-web/node_modules
+    -  zeppelin-web/bower_components
 
 addons:
   apt:
@@ -81,6 +82,14 @@ matrix:
       env: PYTHON="3" SCALA_VER="2.11" SPARK_VER="2.0.0" HADOOP_VER="2.6" PROFILE="-Pspark-2.0 -Phadoop-2.6 -Ppyspark -Pscala-2.11" BUILD_FLAG="package -am -DskipTests -DskipRat" TEST_FLAG="test -DskipRat" MODULES="-pl .,zeppelin-interpreter,zeppelin-display,spark-dependencies,spark,python" TEST_PROJECTS="-Dtest=org.apache.zeppelin.spark.PySpark*Test,org.apache.zeppelin.python.* -Dpyspark.test.exclude='' -DfailIfNoTests=false"
 
 before_install:
+  # check files included in commit range, clear bower_components if a bower.json file has changed.
+  # bower cache clearing can also be forced by putting "bower clear" or "clear bower" in a commit message
+  - changedfiles=$(git diff --name-only $TRAVIS_COMMIT_RANGE 2>/dev/null) || changedfiles=""
+  - echo $changedfiles
+  - hasbowerchanged=$(echo $changedfiles | grep -c "bower.json" || true);
+  - gitlog=$(git log $TRAVIS_COMMIT_RANGE 2>/dev/null) || gitlog="" 
+  - clearcache=$(echo $gitlog | grep -c -E "clear bower|bower clear" || true)
+  - if [ "$hasbowerchanged" -gt 0 ] || [ "$clearcache" -gt 0 ]; then echo "Clearing bower_components cache"; rm -r zeppelin-web/bower_components; npm cache clear; else echo "Using cached bower_components."; fi
   - echo "MAVEN_OPTS='-Xms1024M -Xmx2048M -XX:MaxPermSize=1024m -XX:-UseGCOverheadLimit -Dorg.slf4j.simpleLogger.defaultLogLevel=warn'" >> ~/.mavenrc
   - ./testing/install_external_dependencies.sh
   - ls -la .spark-dist ${HOME}/.m2/repository/.cache/maven-download-plugin || true
@@ -121,4 +130,4 @@ after_failure:
   - cat livy/target/tmp/livy-int-test/*/output.log
   - ls -R livy/target/tmp/livy-int-test/MiniYarnMain/target/com.cloudera.livy.test.framework.MiniYarnMain/*
   - cat livy/target/tmp/livy-int-test/MiniYarnMain/target/com.cloudera.livy.test.framework.MiniYarnMain/*/*/*/stdout
-  - cat livy/target/tmp/livy-int-test/MiniYarnMain/target/com.cloudera.livy.test.framework.MiniYarnMain/*/*/*/stderr
\ No newline at end of file
+  - cat livy/target/tmp/livy-int-test/MiniYarnMain/target/com.cloudera.livy.test.framework.MiniYarnMain/*/*/*/stderr