mirror of
https://github.com/corda/corda.git
synced 2024-12-20 21:43:14 +00:00
f60074e2b5
* JFrog is shutting down JCenter completely and it is not longer available * as very short-term solution switch nightly publishing to R3 Artifactory cache, which already has all necessary binaries downloaded from JCenter previously * add missing configuration for Develocity (formerly Gradle Enterprise) for remote caches
85 lines
2.8 KiB
Groovy
85 lines
2.8 KiB
Groovy
#!groovy
|
|
/**
|
|
* 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
|
|
*/
|
|
@Library('corda-shared-build-pipeline-steps')
|
|
import static com.r3.build.BuildControl.killAllExistingBuildsForJob
|
|
|
|
killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger())
|
|
|
|
pipeline {
|
|
agent { label 'standard' }
|
|
|
|
options {
|
|
timestamps()
|
|
ansiColor('xterm')
|
|
overrideIndexTriggers(false)
|
|
timeout(time: 3, unit: 'HOURS')
|
|
buildDiscarder(logRotator(daysToKeepStr: '14', artifactDaysToKeepStr: '14'))
|
|
}
|
|
|
|
triggers {
|
|
cron 'H 0 * * 1-5'
|
|
}
|
|
|
|
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("/", " :: ")
|
|
BUILD_CACHE_CREDENTIALS = credentials('gradle-ent-cache-credentials')
|
|
BUILD_CACHE_PASSWORD = "${env.BUILD_CACHE_CREDENTIALS_PSW}"
|
|
BUILD_CACHE_USERNAME = "${env.BUILD_CACHE_CREDENTIALS_USR}"
|
|
USE_CACHE = 'corda-remotes'
|
|
DOCKER_URL = "https://index.docker.io/v1/"
|
|
}
|
|
|
|
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 */
|
|
}
|
|
}
|
|
}
|