3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-12-26 00:00:55 +01:00

Make sure Jenkins doesn't run deploy jobs for different branches

Dieser Commit ist enthalten in:
Andrew Steinborn 2018-08-31 16:57:37 -04:00
Ursprung d7e18b2cb1
Commit 576c63893f

13
Jenkinsfile vendored
Datei anzeigen

@ -4,7 +4,6 @@ pipeline {
image 'velocitypowered/openjdk8-plus-git:slim' image 'velocitypowered/openjdk8-plus-git:slim'
args '-v gradle-cache:/root/.gradle:rw -v maven-repo:/maven-repo:rw -v javadoc:/javadoc' args '-v gradle-cache:/root/.gradle:rw -v maven-repo:/maven-repo:rw -v javadoc:/javadoc'
} }
} }
stages { stages {
stage('Build') { stage('Build') {
@ -19,11 +18,23 @@ pipeline {
} }
} }
stage('Deploy Artifacts') { stage('Deploy Artifacts') {
when {
expression {
GIT_BRANCH = sh(returnStdout: true, script: 'git rev-parse --abbrev-ref HEAD').trim()
return GIT_BRANCH == 'origin/master'
}
}
steps { steps {
sh 'export MAVEN_DEPLOYMENT=true; ./gradlew publish' sh 'export MAVEN_DEPLOYMENT=true; ./gradlew publish'
} }
} }
stage('Deploy Javadoc') { stage('Deploy Javadoc') {
when {
expression {
GIT_BRANCH = sh(returnStdout: true, script: 'git rev-parse --abbrev-ref HEAD').trim()
return GIT_BRANCH == 'origin/master'
}
}
steps { steps {
sh 'rsync -av --delete ./api/build/docs/javadoc/ /javadoc' sh 'rsync -av --delete ./api/build/docs/javadoc/ /javadoc'
} }