2018-03-01 12:10:30 +01:00
|
|
|
#!/bin/bash
|
|
|
|
#This script download the last stable build on jenkins
|
|
|
|
|
|
|
|
data=$(curl -g "https://jenkins.seb6596.ovh/job/Bot%20Discord%20Gradle/lastStableBuild/api/xml?xpath=/freeStyleBuild/artifact&wrapper=artifacts")
|
|
|
|
relativePath=$(grep -oPm1 "(?<=<relativePath>)[^<]+" <<< "$data")
|
|
|
|
jarFile=$(grep -oPm1 "(?<=<fileName>)[^<]+" <<< "$data")
|
2018-03-01 13:17:32 +01:00
|
|
|
|
2018-03-01 15:21:15 +01:00
|
|
|
echo $1
|
2018-03-01 13:21:42 +01:00
|
|
|
|
2018-03-01 15:21:15 +01:00
|
|
|
if [[ $1="master" ]]; then
|
2018-03-01 13:17:32 +01:00
|
|
|
url="https://jenkins.seb6596.ovh/job/Bot%20Discord%20Gradle/lastStableBuild/artifact/"${relativePath}
|
|
|
|
else
|
|
|
|
url="https://jenkins.seb6596.ovh/job/Bot%20Discord%20Gradle%20Devel/lastStableBuild/artifact/"${relativePath}
|
|
|
|
fi
|
2018-03-01 12:10:30 +01:00
|
|
|
echo ${url}
|
2018-03-01 13:17:32 +01:00
|
|
|
|
2018-03-01 12:10:30 +01:00
|
|
|
wget ${url} -O bot.jar
|
|
|
|
|
|
|
|
|