Bug 1381770 - In tooltool-download.sh, automatically setup the relengapi authentication file. r?mshal draft
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 18 Jul 2017 16:13:26 +0900
changeset 610377 897af4c1b1872f433e302ed7d0194e6c8d8c245e
parent 610376 8b3e3c753332b3e624374f52ca5845a5c3d037ce
child 610378 fefb21d63da52adeab413d959b655eb768a42d74
push id68887
push userbmo:mh+mozilla@glandium.org
push dateTue, 18 Jul 2017 09:07:47 +0000
reviewersmshal
bugs1381770
milestone56.0a1
Bug 1381770 - In tooltool-download.sh, automatically setup the relengapi authentication file. r?mshal
taskcluster/scripts/misc/tooltool-download.sh
--- a/taskcluster/scripts/misc/tooltool-download.sh
+++ b/taskcluster/scripts/misc/tooltool-download.sh
@@ -1,14 +1,28 @@
 # Fetch a tooltool manifest.
 
 cd $WORKSPACE/build/src
 
+case "`uname -s`" in
+Linux)
+    TOOLTOOL_AUTH_FILE=/builds/relengapi.tok
+    ;;
+MINGW*)
+    TOOLTOOL_AUTH_FILE=c:/builds/relengapi.tok
+    ;;
+esac
+
 TOOLTOOL_DL_FLAGS=
 
+if [ -e "$TOOLTOOL_AUTH_FILE" ]; then
+    # When the worker has the relengapi token pass it down
+    TOOLTOOL_DL_FLAGS="${TOOLTOOL_DL_FLAGS=} --authentication-file=$TOOLTOOL_AUTH_FILE"
+fi
+
 if [ -n "$RELENGAPI_PORT" ]; then
     # When the worker has the relengapi proxy setup, use it.
     TOOLTOOL_DL_FLAGS="${TOOLTOOL_DL_FLAGS=} --tooltool-url=http://relengapi/tooltool/"
 fi
 
 : TOOLTOOL_CACHE                ${TOOLTOOL_CACHE:=/home/worker/tooltool-cache}
 export TOOLTOOL_CACHE