2020-01-24 10:39:23 +00:00
|
|
|
@Library('corda-shared-build-pipeline-steps')
|
2019-12-20 14:44:45 +00:00
|
|
|
import static com.r3.build.BuildControl.killAllExistingBuildsForJob
|
|
|
|
|
|
|
|
killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger())
|
|
|
|
|
|
|
|
pipeline {
|
2020-04-17 14:52:47 +00:00
|
|
|
agent { label 'k8s' }
|
2019-12-20 14:44:45 +00:00
|
|
|
options {
|
|
|
|
timestamps()
|
|
|
|
overrideIndexTriggers(false)
|
2020-02-12 14:26:06 +00:00
|
|
|
timeout(time: 3, unit: 'HOURS')
|
2020-07-15 09:17:58 +00:00
|
|
|
buildDiscarder(logRotator(daysToKeepStr: '14', artifactDaysToKeepStr: '14'))
|
2019-12-20 14:44:45 +00:00
|
|
|
}
|
|
|
|
triggers {
|
|
|
|
pollSCM ignorePostCommitHooks: true, scmpoll_spec: '@midnight'
|
|
|
|
}
|
|
|
|
|
|
|
|
environment {
|
|
|
|
DOCKER_TAG_TO_USE = "${env.GIT_COMMIT.subSequence(0, 8)}"
|
|
|
|
EXECUTOR_NUMBER = "${env.EXECUTOR_NUMBER}"
|
|
|
|
BUILD_ID = "${env.BUILD_ID}-${env.JOB_NAME}"
|
|
|
|
ARTIFACTORY_CREDENTIALS = credentials('artifactory-credentials')
|
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
2020-06-12 14:30:15 +00:00
|
|
|
stage('Deploy Nodes') {
|
|
|
|
steps {
|
|
|
|
sh "./gradlew --no-daemon jar deployNodes"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Generate Build Image') {
|
|
|
|
steps {
|
|
|
|
withCredentials([string(credentialsId: 'container_reg_passwd', variable: 'DOCKER_PUSH_PWD')]) {
|
|
|
|
sh "./gradlew " +
|
|
|
|
"-Dkubenetize=true " +
|
|
|
|
"-Ddocker.push.password=\"\${DOCKER_PUSH_PWD}\" " +
|
|
|
|
"-Ddocker.work.dir=\"/tmp/\${EXECUTOR_NUMBER}\" " +
|
|
|
|
"-Ddocker.build.tag=\"\${DOCKER_TAG_TO_USE}\"" +
|
|
|
|
" clean pushBuildImage --stacktrace"
|
2019-12-20 14:44:45 +00:00
|
|
|
}
|
2020-06-12 14:30:15 +00:00
|
|
|
sh "kubectl auth can-i get pods"
|
2019-12-20 14:44:45 +00:00
|
|
|
}
|
2020-06-12 14:30:15 +00:00
|
|
|
}
|
2019-12-20 14:44:45 +00:00
|
|
|
|
2020-06-12 14:30:15 +00:00
|
|
|
stage('Testing phase') {
|
|
|
|
parallel {
|
|
|
|
stage('Regression Test') {
|
|
|
|
steps {
|
|
|
|
sh "./gradlew " +
|
|
|
|
"-DbuildId=\"\${BUILD_ID}\" " +
|
|
|
|
"-Dkubenetize=true " +
|
|
|
|
"-Ddocker.run.tag=\"\${DOCKER_TAG_TO_USE}\" " +
|
|
|
|
"-Dartifactory.username=\"\${ARTIFACTORY_CREDENTIALS_USR}\" " +
|
|
|
|
"-Dartifactory.password=\"\${ARTIFACTORY_CREDENTIALS_PSW}\" " +
|
|
|
|
"-Dgit.branch=\"\${GIT_BRANCH}\" " +
|
|
|
|
"-Dgit.target.branch=\"\${GIT_BRANCH}\" " +
|
|
|
|
" parallelRegressionTest --stacktrace"
|
2020-03-03 11:16:38 +00:00
|
|
|
}
|
2020-06-12 14:30:15 +00:00
|
|
|
}
|
|
|
|
stage('Slow Integration Test') {
|
|
|
|
steps {
|
|
|
|
sh "./gradlew " +
|
|
|
|
"-DbuildId=\"\${BUILD_ID}\" " +
|
|
|
|
"-Dkubenetize=true " +
|
|
|
|
"-Ddocker.run.tag=\"\${DOCKER_TAG_TO_USE}\" " +
|
|
|
|
"-Dartifactory.username=\"\${ARTIFACTORY_CREDENTIALS_USR}\" " +
|
|
|
|
"-Dartifactory.password=\"\${ARTIFACTORY_CREDENTIALS_PSW}\" " +
|
|
|
|
"-Dgit.branch=\"\${GIT_BRANCH}\" " +
|
|
|
|
"-Dgit.target.branch=\"\${GIT_BRANCH}\" " +
|
|
|
|
" allParallelSlowIntegrationTest --stacktrace"
|
2020-03-03 11:16:38 +00:00
|
|
|
}
|
|
|
|
}
|
2019-12-20 14:44:45 +00:00
|
|
|
}
|
|
|
|
}
|
2020-06-12 14:30:15 +00:00
|
|
|
}
|
2019-12-20 14:44:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
post {
|
|
|
|
always {
|
|
|
|
archiveArtifacts artifacts: '**/pod-logs/**/*.log', fingerprint: false
|
2020-07-21 14:47:01 +00:00
|
|
|
junit testResults: '**/build/test-results-xml/**/*.xml', keepLongStdio: true
|
2019-12-20 14:44:45 +00:00
|
|
|
}
|
|
|
|
cleanup {
|
|
|
|
deleteDir() /* clean up our workspace */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|