Branch test
This commit is contained in:
parent
b12383b97a
commit
fc6ee7bf2d
@ -3,6 +3,7 @@ RUN apt-get update
|
|||||||
RUN apt-get -y upgrade
|
RUN apt-get -y upgrade
|
||||||
RUN apt-get -y install openjdk-8-jre openjdk-8-jdk curl wget
|
RUN apt-get -y install openjdk-8-jre openjdk-8-jdk curl wget
|
||||||
WORKDIR /bot_src
|
WORKDIR /bot_src
|
||||||
|
ENV BRANCH_NAME=$BRANCH_NAME
|
||||||
ADD DownloadLast.sh /bot_src/
|
ADD DownloadLast.sh /bot_src/
|
||||||
RUN chmod +x DownloadLast.sh
|
RUN chmod +x DownloadLast.sh
|
||||||
RUN ./DownloadLast.sh
|
RUN ./DownloadLast.sh
|
||||||
|
@ -4,8 +4,14 @@
|
|||||||
data=$(curl -g "https://jenkins.seb6596.ovh/job/Bot%20Discord%20Gradle/lastStableBuild/api/xml?xpath=/freeStyleBuild/artifact&wrapper=artifacts")
|
data=$(curl -g "https://jenkins.seb6596.ovh/job/Bot%20Discord%20Gradle/lastStableBuild/api/xml?xpath=/freeStyleBuild/artifact&wrapper=artifacts")
|
||||||
relativePath=$(grep -oPm1 "(?<=<relativePath>)[^<]+" <<< "$data")
|
relativePath=$(grep -oPm1 "(?<=<relativePath>)[^<]+" <<< "$data")
|
||||||
jarFile=$(grep -oPm1 "(?<=<fileName>)[^<]+" <<< "$data")
|
jarFile=$(grep -oPm1 "(?<=<fileName>)[^<]+" <<< "$data")
|
||||||
|
|
||||||
|
if [[ $BRANCH_NAME=="master" ]]; then
|
||||||
url="https://jenkins.seb6596.ovh/job/Bot%20Discord%20Gradle/lastStableBuild/artifact/"${relativePath}
|
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
|
||||||
echo ${url}
|
echo ${url}
|
||||||
|
|
||||||
wget ${url} -O bot.jar
|
wget ${url} -O bot.jar
|
||||||
|
|
||||||
|
|
||||||
|
8
Jenkinsfile
vendored
8
Jenkinsfile
vendored
@ -12,8 +12,14 @@ node {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
stage('Gradle Buil'){
|
stage('Gradle Build'){
|
||||||
|
script {
|
||||||
|
if (env.BRANCH_NAME == 'master') {
|
||||||
build job: 'Bot Discord Gradle', wait: true
|
build job: 'Bot Discord Gradle', wait: true
|
||||||
|
} else {
|
||||||
|
build job: 'Bot Discord Gradle devel', wait: true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
stage('Build image') {
|
stage('Build image') {
|
||||||
/* This builds the actual image; synonymous to
|
/* This builds the actual image; synonymous to
|
||||||
|
Loading…
Reference in New Issue
Block a user