2018-07-26 13:03:59 +08:00
|
|
|
pipeline {
|
|
|
|
agent {
|
|
|
|
docker {
|
2018-08-22 11:42:31 +08:00
|
|
|
image 'velocitypowered/openjdk8-plus-git:slim'
|
2018-08-25 12:42:54 +08:00
|
|
|
args '-v gradle-cache:/root/.gradle:rw -v maven-repo:/maven-repo:rw -v javadoc:/javadoc'
|
2018-07-26 13:03:59 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stages {
|
|
|
|
stage('Build') {
|
|
|
|
steps {
|
2018-09-01 09:34:00 +08:00
|
|
|
sh './gradlew build'
|
2018-08-01 09:07:18 +08:00
|
|
|
archiveArtifacts 'proxy/build/libs/*-all.jar,api/build/libs/*-all.jar'
|
2018-07-26 13:03:59 +08:00
|
|
|
}
|
|
|
|
}
|
2018-08-22 11:26:41 +08:00
|
|
|
stage('Deploy Artifacts') {
|
2018-09-01 04:57:37 +08:00
|
|
|
when {
|
|
|
|
expression {
|
|
|
|
GIT_BRANCH = sh(returnStdout: true, script: 'git rev-parse --abbrev-ref HEAD').trim()
|
2018-09-01 04:59:15 +08:00
|
|
|
return GIT_BRANCH == 'master'
|
2018-09-01 04:57:37 +08:00
|
|
|
}
|
|
|
|
}
|
2018-08-22 11:26:41 +08:00
|
|
|
steps {
|
2018-08-22 11:35:09 +08:00
|
|
|
sh 'export MAVEN_DEPLOYMENT=true; ./gradlew publish'
|
2018-08-22 11:26:41 +08:00
|
|
|
}
|
|
|
|
}
|
2018-08-25 12:42:54 +08:00
|
|
|
stage('Deploy Javadoc') {
|
2018-09-01 04:57:37 +08:00
|
|
|
when {
|
|
|
|
expression {
|
|
|
|
GIT_BRANCH = sh(returnStdout: true, script: 'git rev-parse --abbrev-ref HEAD').trim()
|
2018-09-01 04:59:15 +08:00
|
|
|
return GIT_BRANCH == 'master'
|
2018-09-01 04:57:37 +08:00
|
|
|
}
|
|
|
|
}
|
2018-08-25 12:42:54 +08:00
|
|
|
steps {
|
2018-08-25 12:44:32 +08:00
|
|
|
sh 'rsync -av --delete ./api/build/docs/javadoc/ /javadoc'
|
2018-08-25 12:42:54 +08:00
|
|
|
}
|
|
|
|
}
|
2018-07-26 13:03:59 +08:00
|
|
|
}
|
|
|
|
}
|