Skip to content

Commit be11317

Browse files
author
Brennon York
committed
added switch to silence download progress only if AMPLAB_JENKINS is set
1 parent 28d0a99 commit be11317

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

build/mvn

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,26 @@ install_app() {
1313
local remote_tarball="$1/$2"
1414
local local_tarball="${_DIR}/$2"
1515
local binary="${_DIR}/$3"
16+
17+
# setup `curl` and `wget` silent options if we're running on Jenkins
18+
local curl_opts=""
19+
local wget_opts=""
20+
if [ -n "$AMPLAB_JENKINS" ]; then
21+
curl_opts="-s"
22+
wget_opts="--quiet"
23+
fi
24+
1625
if [ -z "$3" -o ! -f "$binary" ]; then
1726
# check if we already have the tarball
1827
# check if we have curl installed
1928
# download application
2029
[ ! -f "${local_tarball}" ] && [ -n "`which curl 2>/dev/null`" ] && \
21-
echo "exec: curl -s ${remote_tarball}" && \
22-
curl -s "${remote_tarball}" > "${local_tarball}"
30+
echo "exec: curl ${curl_opts} ${remote_tarball}" && \
31+
curl ${curl_opts} "${remote_tarball}" > "${local_tarball}"
2332
# if the file still doesn't exist, lets try `wget` and cross our fingers
2433
[ ! -f "${local_tarball}" ] && [ -n "`which wget 2>/dev/null`" ] && \
25-
echo "exec: wget --quiet ${remote_tarball}" && \
26-
wget --quiet -O "${local_tarball}" "${remote_tarball}"
34+
echo "exec: wget ${wget_opts} ${remote_tarball}" && \
35+
wget ${wget_opts} -O "${local_tarball}" "${remote_tarball}"
2736
# if both were unsuccessful, exit
2837
[ ! -f "${local_tarball}" ] && \
2938
echo -n "ERROR: Cannot download $2 with cURL or wget; " && \

0 commit comments

Comments
 (0)