corda/.ci/dev/pr-code-checks/Jenkinsfile
Connel McGovern 2ce0409bd2
INFRA-2021: Temp fix for Snyk Delta
Moving the position of the Snyk Delta to execute as the first stage as there seems to be issues with running the under the hood 'snykResolvedDepsJson' task after other gradle tasks have been executed. To be investigated further but this should unblock and PR's hitting the Snyk Delta stage.
2023-02-17 14:58:14 +00:00

75 lines
2.0 KiB
Groovy

@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()
timeout(time: 3, unit: 'HOURS')
buildDiscarder(logRotator(daysToKeepStr: '14', artifactDaysToKeepStr: '14'))
}
/*
* 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')
}
stages {
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 {
sh 'mkdir -p ${GRADLE_USER_HOME}'
snykDeltaScan(env.SNYK_API_TOKEN, env.C4_OS_SNYK_ORG_ID)
}
}
stage('Detekt check') {
steps {
authenticateGradleWrapper()
sh "./gradlew --no-daemon clean detekt"
}
}
stage('Compilation warnings check') {
steps {
sh "./gradlew --no-daemon -Pcompilation.warningsAsErrors=true compileAll"
}
}
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 */
}
}
}