2020-07-28 08:36:11 +00:00
|
|
|
#!groovy
|
|
|
|
/**
|
|
|
|
* Jenkins pipeline to build Corda OS KDoc & Javadoc archive
|
|
|
|
*/
|
2020-07-16 09:46:42 +00:00
|
|
|
|
2020-07-28 08:36:11 +00:00
|
|
|
/**
|
|
|
|
* Kill already started job.
|
|
|
|
* Assume new commit takes precendence and results from previous
|
|
|
|
* unfinished builds are not required.
|
|
|
|
* This feature doesn't play well with disableConcurrentBuilds() option
|
|
|
|
*/
|
|
|
|
@Library('corda-shared-build-pipeline-steps')
|
2020-07-16 09:46:42 +00:00
|
|
|
import static com.r3.build.BuildControl.killAllExistingBuildsForJob
|
|
|
|
|
|
|
|
killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger())
|
|
|
|
|
|
|
|
pipeline {
|
|
|
|
agent { label 'standard' }
|
|
|
|
options {
|
|
|
|
ansiColor('xterm')
|
|
|
|
timestamps()
|
|
|
|
timeout(time: 3, unit: 'HOURS')
|
2020-07-28 08:36:11 +00:00
|
|
|
buildDiscarder(logRotator(daysToKeepStr: '14', artifactDaysToKeepStr: '14'))
|
2020-07-16 09:46:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
environment {
|
|
|
|
ARTIFACTORY_CREDENTIALS = credentials('artifactory-credentials')
|
|
|
|
CORDA_ARTIFACTORY_USERNAME = "${env.ARTIFACTORY_CREDENTIALS_USR}"
|
|
|
|
CORDA_ARTIFACTORY_PASSWORD = "${env.ARTIFACTORY_CREDENTIALS_PSW}"
|
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
|
|
|
stage('Publish Archived API Docs to Artifactory') {
|
2020-07-28 08:36:11 +00:00
|
|
|
when { tag pattern: /^docs-release-os-V(\d+\.\d+)(\.\d+){0,1}(-GA){0,1}(-\d{4}-\d\d-\d\d-\d{4}){0,1}$/, comparator: 'REGEXP' }
|
2020-07-16 09:46:42 +00:00
|
|
|
steps {
|
|
|
|
sh "./gradlew :clean :docs:artifactoryPublish -DpublishApiDocs"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
post {
|
|
|
|
cleanup {
|
|
|
|
deleteDir() /* clean up our workspace */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|