corda/.ci/dev/publish-branch/Jenkinsfile.preview
Waldemar Żurowski 286873a4e4
INFRA-1299: switch from Azure Jenkins agents to AWS (#6911)
* JDK11 compatibility - simply switch to AWS Jenkins agent
* Corda preview - simply switch from Azure agent to AWS agent
* part of retiring `k8s` agent used for parallel builds
2021-06-02 14:23:30 +02:00

70 lines
2.3 KiB
Groovy

#!groovy
/**
* Jenkins pipeline to build Corda Opensource Preview.
*/
@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'))
}
environment {
// Replace / with :: as links from Jenkins to Artifactory are broken if we use slashes
// in the name
ARTIFACTORY_BUILD_NAME = "Corda / Publish / Publish Preview to Artifactory"
.replaceAll("/", " :: ")
}
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 -PversionFromGit",
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 */
}
}
}