From 6ba6aa5b61a06f595140c8d1c2b0f59b0b77e23c Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Sat, 1 Feb 2014 01:11:47 +0100 Subject: [PATCH] Fixed jenkins script on places where cURL is not installed --- src/build/jenkins.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/build/jenkins.sh b/src/build/jenkins.sh index fcf9017a5..2cea654fc 100644 --- a/src/build/jenkins.sh +++ b/src/build/jenkins.sh @@ -1,8 +1,23 @@ #!/bin/bash -x export PATH=/opt/arm-2013.05/bin:/opt/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin:$PATH export THREADS=2 + +#Needed to use aliases +shopt -s expand_aliases +type wget > /dev/null 2>&1 +if [ $? -eq 0 ]; then + alias download_file="wget --no-check-certificate -q -O -" +else + type curl >> /dev/null 2>&1 + if [ $? -eq 0 ]; then + alias download_file="curl --insecure --silent --location" + else + echo "error, curl or wget not found" + fi +fi + rm -rf $WORKSPACE/compile.sh -curl --insecure --location "https://github.com/PocketMine/PocketMine-MP/raw/master/src/build/compile.sh" > $WORKSPACE/compile.sh +download_file "https://github.com/PocketMine/PocketMine-MP/raw/master/src/build/compile.sh" > $WORKSPACE/compile.sh chmod +x $WORKSPACE/compile.sh SCRIPT="$WORKSPACE/compile.sh" ARCHIVE=$WORKSPACE/archive