aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorbartus2019-10-08 21:08:43 +0200
committerbartus2019-10-08 21:15:22 +0200
commit849bfabb910b2bd0bd653c26d8b0d6b45e8ff843 (patch)
tree05e0878890cd2b0046055524b6072d97c5077818
parent1b0dd1d97a79375987ef2a02c123d9622a0a077a (diff)
downloadaur-849bfabb910b2bd0bd653c26d8b0d6b45e8ff843.tar.gz
Travis: detect no cache in.
Assume 5min cache out time if no cache in.
-rw-r--r--.travis.yml4
1 files changed, 3 insertions, 1 deletions
diff --git a/.travis.yml b/.travis.yml
index 0ad938e71f12..41d3943a16d3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -66,7 +66,9 @@ script:
- "export travis_uptime=$(cut -d' ' -f1 /proc/uptime|cut -d'.' -f1)"
- 'echo "Travis initialization time: $travis_uptime seconds"'
# assume caching out will take the same amount of time as caching in those making build time equal to 50 minutes minus two time current uptime.
-- "curl -s https://raw.githubusercontent.com/bartoszek/arch-travis/master/arch-travis.sh| timeout $((50*60-2*travis_uptime)) bash"
+# detect no cache in and assume 5min cache out time.
+- "[ $travis_uptime -le 60 ] && cache_out_time=300 || cache_out_time=$travis_uptime"
+- "curl -s https://raw.githubusercontent.com/bartoszek/arch-travis/master/arch-travis.sh| timeout $((50*60-travis_uptime-cache_out_time)) bash"
- "echo pacman pkg cache size: $(du -h ~/.pkg-cache|cut -f1) in $(ls ~/.pkg-cache|wc -l) files"
#deploy: