geforkt von Mirrors/Velocity
1e04d27bb7
Since we are using separate containers for each pipeline stage, the daemons get nicked once the stage is done. Why bother having them?
35 Zeilen
951 B
Groovy
35 Zeilen
951 B
Groovy
pipeline {
|
|
agent none
|
|
stages {
|
|
stage('Build') {
|
|
agent {
|
|
docker {
|
|
image 'velocitypowered/openjdk8-plus-git:slim'
|
|
args '-v gradle-cache:/root/.gradle:rw'
|
|
}
|
|
}
|
|
steps {
|
|
sh './gradlew build --no-daemon'
|
|
archiveArtifacts 'proxy/build/libs/*-all.jar,api/build/libs/*-all.jar'
|
|
}
|
|
}
|
|
stage('Deploy') {
|
|
when {
|
|
expression {
|
|
GIT_BRANCH = sh(returnStdout: true, script: 'git rev-parse --abbrev-ref HEAD').trim()
|
|
return GIT_BRANCH == 'master'
|
|
}
|
|
}
|
|
agent {
|
|
docker {
|
|
image 'velocitypowered/openjdk8-plus-git:slim'
|
|
args '-v gradle-cache:/root/.gradle:rw -v maven-repo:/maven-repo:rw -v javadoc:/javadoc:rw'
|
|
}
|
|
}
|
|
steps {
|
|
sh 'export MAVEN_DEPLOYMENT=true; ./gradlew publish --no-daemon'
|
|
sh 'rsync -av --delete ./api/build/docs/javadoc/ /javadoc'
|
|
}
|
|
}
|
|
}
|
|
} |