Configured curl to load credentials from .netrc file.

This commit is contained in:
Sorin Sbarnea 2015-06-30 12:41:11 +01:00
parent ad2215d2ce
commit fe4f84322a
3 changed files with 6 additions and 6 deletions

View File

@ -45,17 +45,17 @@ else
fi
url="${JENKINS_SERVER}/job/${get_JOB_NAME}/"
if curl -s --head --fail "${url}"; then
if curl -n -s --head --fail "${url}"; then
echo "URL exists: ${url}"
else
echo "URL does not exist: ${url}"
exit 1
fi
NEXT_BN=$(curl "http://hg.uk.xensource.com/cgi/next-xenadmin?job=$get_JOB_NAME&number=$get_BUILD_NUMBER&rev=$get_REVISION")
NEXT_BN=$(curl -n "http://hg.uk.xensource.com/cgi/next-xenadmin?job=$get_JOB_NAME&number=$get_BUILD_NUMBER&rev=$get_REVISION")
echo NEXT_BN=${NEXT_BN}
curl --data "nextBuildNumber=${NEXT_BN}" --header "Content-Type: application/x-www-form-urlencoded" ${JENKINS_SERVER}/job/${get_JOB_NAME}/nextbuildnumber/submit
curl -n --data "nextBuildNumber=${NEXT_BN}" --header "Content-Type: application/x-www-form-urlencoded" ${JENKINS_SERVER}/job/${get_JOB_NAME}/nextbuildnumber/submit
set +u

View File

@ -39,7 +39,7 @@ ROOTURL=https://xenbuilder.uk.xensource.com
DEFAULT_OUTPUT=Red
#Get the cookie
curl -q -s -k $ROOTURL/plainlogin -o /dev/null -c /tmp/cookie$$
curl -n -q -s -k $ROOTURL/plainlogin -o /dev/null -c /tmp/cookie$$
#If this fails then declare the trunk red as there is a problem with the server
#otherwise try to work out the actual color of the trunk
@ -47,7 +47,7 @@ if [ $? -ne 0 ]; then
echo $DEFAULT_OUTPUT
exit 1
else
curl -q -s -k $ROOTURL/ -o - -b /tmp/cookie$$ | sed -ne 's/.*Trunk is.*\(Green\|Red\|Orange\).*/\1/Ip'
curl -n -q -s -k $ROOTURL/ -o - -b /tmp/cookie$$ | sed -ne 's/.*Trunk is.*\(Green\|Red\|Orange\).*/\1/Ip'
rm /tmp/cookie$$
fi

View File

@ -118,7 +118,7 @@ get_BUILD_URL=${BUILD_URL}
if [ -z "${WORKSPACE+xxx}" ]
then
DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )/../.." && pwd )"
WORKSPACE=${DIR}
WORKSPACE="${DIR}"
echo "Warning: WORKSPACE env var not set, we will use ${WORKSPACE}"
fi