2020-07-22 08:08:49 +00:00
|
|
|
@Library('corda-shared-build-pipeline-steps')
|
|
|
|
import static com.r3.build.BuildControl.killAllExistingBuildsForJob
|
|
|
|
|
|
|
|
killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger())
|
|
|
|
|
|
|
|
pipeline {
|
2021-06-01 14:21:22 +00:00
|
|
|
agent { label 'standard' }
|
2020-07-22 08:08:49 +00:00
|
|
|
options {
|
|
|
|
timestamps()
|
|
|
|
timeout(time: 3, unit: 'HOURS')
|
|
|
|
buildDiscarder(logRotator(daysToKeepStr: '14', artifactDaysToKeepStr: '14'))
|
|
|
|
}
|
|
|
|
|
2022-12-12 13:57:40 +00:00
|
|
|
/*
|
|
|
|
* List environment variables in alphabetical order
|
|
|
|
*/
|
|
|
|
environment {
|
|
|
|
SNYK_API_TOKEN = credentials('c4-os-snyk-api-token-secret')
|
|
|
|
C4_OS_SNYK_ORG_ID = credentials('c4-os-snyk-org-id')
|
2023-06-23 19:46:36 +00:00
|
|
|
ARTIFACTORY_CREDENTIALS = credentials('artifactory-credentials')
|
|
|
|
CORDA_ARTIFACTORY_PASSWORD = "${env.ARTIFACTORY_CREDENTIALS_PSW}"
|
|
|
|
CORDA_ARTIFACTORY_USERNAME = "${env.ARTIFACTORY_CREDENTIALS_USR}"
|
|
|
|
CORDA_USE_CACHE = "corda-remotes"
|
2022-12-12 13:57:40 +00:00
|
|
|
}
|
|
|
|
|
2020-07-22 08:08:49 +00:00
|
|
|
stages {
|
2023-02-21 11:40:39 +00:00
|
|
|
stage('Detekt check') {
|
|
|
|
steps {
|
|
|
|
authenticateGradleWrapper()
|
|
|
|
sh "./gradlew --no-daemon clean detekt"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Compilation warnings check') {
|
|
|
|
steps {
|
|
|
|
sh "./gradlew --no-daemon -Pcompilation.warningsAsErrors=true compileAll"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-12 13:57:40 +00:00
|
|
|
stage('Snyk Delta') {
|
|
|
|
agent {
|
|
|
|
docker {
|
|
|
|
image 'build-zulu-openjdk:8'
|
|
|
|
reuseNode true
|
|
|
|
registryUrl 'https://engineering-docker.software.r3.com/'
|
|
|
|
registryCredentialsId 'artifactory-credentials'
|
|
|
|
args '-v /tmp:/host_tmp'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
environment {
|
|
|
|
GRADLE_USER_HOME = "/host_tmp/gradle"
|
|
|
|
}
|
|
|
|
steps {
|
2023-03-22 13:22:12 +00:00
|
|
|
authenticateGradleWrapper()
|
2022-12-12 13:57:40 +00:00
|
|
|
sh 'mkdir -p ${GRADLE_USER_HOME}'
|
2023-02-21 11:54:38 +00:00
|
|
|
authenticateGradleWrapper()
|
2022-12-12 13:57:40 +00:00
|
|
|
snykDeltaScan(env.SNYK_API_TOKEN, env.C4_OS_SNYK_ORG_ID)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-22 08:08:49 +00:00
|
|
|
stage('No API change check') {
|
|
|
|
steps {
|
|
|
|
sh "./gradlew --no-daemon generateApi"
|
|
|
|
sh ".ci/check-api-changes.sh"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Deploy Nodes') {
|
|
|
|
steps {
|
|
|
|
sh "./gradlew --no-daemon jar deployNodes"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
post {
|
|
|
|
cleanup {
|
|
|
|
deleteDir() /* clean up our workspace */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|