openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chet...@apache.org
Subject [incubator-openwhisk] branch master updated: Make gradle and dependency downloads more stable. (#3960)
Date Mon, 13 Aug 2018 13:45:21 GMT
This is an automated email from the ASF dual-hosted git repository.

chetanm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new 7b5d805  Make gradle and dependency downloads more stable. (#3960)
7b5d805 is described below

commit 7b5d8057ca9dcae9ae170318c39387a3fb684f67
Author: Markus Thömmes <markusthoemmes@me.com>
AuthorDate: Mon Aug 13 15:45:17 2018 +0200

    Make gradle and dependency downloads more stable. (#3960)
    
    Gradle wrapper and dependency downloads are subject to intermittent failures. This commit
adds the travis caching feature to cache the wrapper and caches. Moreover, it retries those
downloads to be resilient against hiccups.
---
 .travis.yml           | 11 +++++++++++
 tools/travis/setup.sh | 21 +++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/.travis.yml b/.travis.yml
index 12551d8..b9056cd 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -45,6 +45,17 @@ notifications:
       # travis2slack webhook to enable DMs on openwhisk-team.slack.com to PR authors with
TravisCI results
       secure: "tYJIDAKtHp+yLw53yB6+TQnNfyNwZDAZyG7QmHbNP5Mf1HR0GLhpe02AjV99NkjAgaGYxngUELMhNOyB8eiyMdxpemwny4oOeyOUQzVmiry/804JnjK2YvHyAGFVGuhV0LZVfCPsPh5x91yKcDPLSqRSTKhZOiJFmDpBy4qzxM4W7IXxAM+yHKrm8cznBRdR5rGxT5IjV58xMB1p69jJy1rxnjtEWmB2z7j/SiKa6IQlVYgr+BgaJxBhy9WYYczvceU+qyrTWpVYy5P3o5+b0MZ/UkyB5CZT9N5LzLGjLRDqNaNYCT3U8ow1H6w+zY7/9KrAf6szT6raN606vN7uv7TqGEugG949JQfRSQNe3Y7IvTAHatI9VAc3opWgy0jm7eBu9pzSECamGGSGGHl18m7oWZypiwB+ooKg7k545XQCoVwlRulBvwnVO8w2HOjkKSds/JnNhdXLtNKRaBaZxhBkk+5b4
[...]
 
+# specific cache configuration for gradle based builds
+# see: https://docs.travis-ci.com/user/languages/java/#caching
+before_cache:
+  - rm -f  $HOME/.gradle/caches/modules-2/modules-2.lock
+  - rm -fr $HOME/.gradle/caches/*/plugin-resolution/
+
+cache:
+  directories:
+    - $HOME/.gradle/caches/
+    - $HOME/.gradle/wrapper/
+
 before_install:
   - pip install --upgrade pip setuptools six
   - pip3 install --upgrade pip setuptools six
diff --git a/tools/travis/setup.sh b/tools/travis/setup.sh
index bc16774..f13b58a 100755
--- a/tools/travis/setup.sh
+++ b/tools/travis/setup.sh
@@ -16,6 +16,20 @@
 # limitations under the License.
 #
 
+# retries a command for five times and exits with the non-zero exit if even after
+# the retries the command did not succeed.
+function retry() {
+  local exitcode=0
+  for i in {1..5};
+  do
+    exitcode=0
+    "$@" && break || exitcode=$? && echo "$i. attempt failed. Will retry
$((5-i)) more times!" && sleep 1;
+  done
+  if [ $exitcode -ne 0 ]; then
+    exit $exitcode
+  fi
+}
+
 sudo gpasswd -a travis docker
 sudo -E bash -c 'echo '\''DOCKER_OPTS="-H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock
--storage-driver=overlay --userns-remap=default"'\'' > /etc/default/docker'
 
@@ -36,3 +50,10 @@ pip install --user ansible==2.5.2
 
 # Azure CosmosDB
 pip install --user pydocumentdb
+
+# Basic check that all code compiles and depdendencies are downloaded correctly.
+# Compiling the tests will compile all components as well.
+#
+# Downloads the gradle wrapper, dependencies and tries to compile the code.
+# Retried 5 times in case there are network hiccups.
+TERM=dumb retry ./gradlew :tests:compileTestScala


Mime
View raw message