ci: output Travis folding markers for each build stage

Makes build logs vastly more readable on Travis web UI

Change-Id: I00ebf48f80d73d7aad00b890d9c16c2254cb609c
diff --git a/.jenkins b/.jenkins
index 674d751..78e1ca1 100755
--- a/.jenkins
+++ b/.jenkins
@@ -1,10 +1,27 @@
 #!/usr/bin/env bash
 set -e
 
-DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+nanos() {
+    # Cannot use date(1) because macOS does not support %N format specifier
+    python -c 'import time; print(int(time.time() * 1e9))'
+}
 
-for file in "$DIR"/.jenkins.d/*; do
+for file in .jenkins.d/*; do
     [[ -f $file && -x $file ]] || continue
-    echo "Run: $file"
+
+    if [[ -n $TRAVIS ]]; then
+        label=$(basename "$file" | sed -E 's/[[:digit:]]+-(.*)\..*/\1/')
+        echo -ne "travis_fold:start:${label}\r"
+        echo -ne "travis_time:start:${label}\r"
+        start=$(nanos)
+    fi
+
+    echo "\$ $file"
     "$file"
+
+    if [[ -n $TRAVIS ]]; then
+        finish=$(nanos)
+        echo -ne "travis_time:end:${label}:start=${start},finish=${finish},duration=$((finish-start)),event=${label}\r"
+        echo -ne "travis_fold:end:${label}\r"
+    fi
 done
diff --git a/.jenkins.d/00-deps.sh b/.jenkins.d/00-deps.sh
index 2a8d230..ba85553 100755
--- a/.jenkins.d/00-deps.sh
+++ b/.jenkins.d/00-deps.sh
@@ -16,7 +16,7 @@
 
     brew update
     if [[ -n $TRAVIS ]]; then
-        # travis images come with a large number of brew packages
+        # Travis images come with a large number of brew packages
         # pre-installed, don't waste time upgrading all of them
         for FORMULA in "${FORMULAE[@]}"; do
             brew outdated $FORMULA || brew upgrade $FORMULA
@@ -38,7 +38,7 @@
     fi
 fi
 
-if has CentOS $NODE_LABELS; then
+if has CentOS-7 $NODE_LABELS; then
     sudo yum -y install yum-utils pkgconfig \
                         openssl-devel libtranslit-icu \
                         python-devel sqlite-devel \
diff --git a/.travis.yml b/.travis.yml
index d98dd24..570bb0e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -97,6 +97,8 @@
 before_script:
   - if [[ ${TRAVIS_OS_NAME} == linux ]]; then export NODE_LABELS="Linux Ubuntu Ubuntu-18.04"; fi
   - if [[ ${TRAVIS_OS_NAME} == osx ]]; then export NODE_LABELS="OSX OSX-${OSX_VERSION}"; fi
+  # do not waste time upgrading useless packages
+  - if [[ ${TRAVIS_OS_NAME} == osx ]]; then brew pin cgal gdal numpy postgis sfcgal || true; fi
   - if [[ ${OSX_VERSION} == 10.12 ]]; then brew update; fi
   # workaround for https://github.com/Homebrew/homebrew-core/issues/26358
   - if [[ ${OSX_VERSION} == 10.12 ]]; then brew outdated python || brew upgrade python; fi