2020-05-28 21:34:37 +00:00
|
|
|
#!groovy
|
2020-07-22 18:43:08 +00:00
|
|
|
/**
|
|
|
|
* Jenkins pipeline to build Corda OS nightly snapshots
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*/
|
2020-05-28 21:34:37 +00:00
|
|
|
@Library('corda-shared-build-pipeline-steps')
|
|
|
|
import static com.r3.build.BuildControl.killAllExistingBuildsForJob
|
|
|
|
|
|
|
|
killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger())
|
|
|
|
|
|
|
|
pipeline {
|
2020-07-22 18:43:08 +00:00
|
|
|
agent { label 'standard' }
|
2020-05-28 21:34:37 +00:00
|
|
|
|
|
|
|
options {
|
|
|
|
timestamps()
|
|
|
|
ansiColor('xterm')
|
|
|
|
overrideIndexTriggers(false)
|
|
|
|
timeout(time: 3, unit: 'HOURS')
|
2020-07-15 09:17:58 +00:00
|
|
|
buildDiscarder(logRotator(daysToKeepStr: '14', artifactDaysToKeepStr: '14'))
|
2020-08-07 04:07:29 +00:00
|
|
|
}
|
|
|
|
|
2020-05-28 21:34:37 +00:00
|
|
|
triggers {
|
2024-05-01 09:38:19 +00:00
|
|
|
cron 'H 0 * * 1-5'
|
2020-05-28 21:34:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
environment {
|
|
|
|
// Replace / with :: as links from Jenkins to Artifactory are broken if we use slashes
|
|
|
|
// in the name
|
|
|
|
ARTIFACTORY_BUILD_NAME = "Corda / Publish / Publish Nightly to Artifactory"
|
|
|
|
.replaceAll("/", " :: ")
|
2020-06-30 19:12:27 +00:00
|
|
|
DOCKER_URL = "https://index.docker.io/v1/"
|
2020-05-28 21:34:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
|
|
|
stage('Publish to Artifactory') {
|
|
|
|
steps {
|
|
|
|
rtServer (
|
|
|
|
id: 'R3-Artifactory',
|
|
|
|
url: 'https://software.r3.com/artifactory',
|
|
|
|
credentialsId: 'artifactory-credentials'
|
|
|
|
)
|
|
|
|
rtGradleDeployer (
|
|
|
|
id: 'deployer',
|
|
|
|
serverId: 'R3-Artifactory',
|
|
|
|
repo: 'corda-dev',
|
|
|
|
)
|
|
|
|
withCredentials([
|
|
|
|
usernamePassword(credentialsId: 'artifactory-credentials',
|
|
|
|
usernameVariable: 'CORDA_ARTIFACTORY_USERNAME',
|
|
|
|
passwordVariable: 'CORDA_ARTIFACTORY_PASSWORD')]) {
|
|
|
|
rtGradleRun (
|
|
|
|
usesPlugin: true,
|
|
|
|
useWrapper: true,
|
|
|
|
switches: "--no-daemon -s",
|
|
|
|
tasks: 'artifactoryPublish',
|
|
|
|
deployerId: 'deployer',
|
|
|
|
buildName: env.ARTIFACTORY_BUILD_NAME
|
|
|
|
)
|
|
|
|
}
|
|
|
|
rtPublishBuildInfo (
|
|
|
|
serverId: 'R3-Artifactory',
|
|
|
|
buildName: env.ARTIFACTORY_BUILD_NAME
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
post {
|
|
|
|
cleanup {
|
|
|
|
deleteDir() /* clean up our workspace */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|