diff --git a/Jenkinsfile_nightly b/Jenkinsfile_nightly index 0f78d3cc..bab93d10 100644 --- a/Jenkinsfile_nightly +++ b/Jenkinsfile_nightly @@ -1,10 +1,61 @@ #!groovy -@Library("Infrastructure") +properties([ + pipelineTriggers([cron('H 8 * * 1-5')]), +]) +@Library("Infrastructure") +import uk.gov.hmcts.contino.GradleBuilder def type = "java" def product = "ia" def component = "task-configuration" -withPipeline(type, product, component) { +GradleBuilder builder = new GradleBuilder(this, product) +withNightlyPipeline(type, product, component) { + afterAlways('build') { + stage('Checkstyle and unit tests') { + try { + builder.gradle('check') + } catch (Error) { + unstable(message: "${STAGE_NAME} is unstable") + } finally { + publishHTML target: [ + allowMissing : true, + alwaysLinkToLastBuild: true, + keepAll : true, + reportDir : "build/reports/tests/test", + reportFiles : "index.html", + reportName : "Unit Test Report" + ] + } + } + stage('Integration Tests') { + try { + builder.gradle('integration') + } catch (Error) { + unstable(message: "${STAGE_NAME} is unstable") + } finally { + publishHTML target: [ + allowMissing : true, + alwaysLinkToLastBuild: true, + keepAll : true, + reportDir : "build/reports/tests/integration", + reportFiles : "index.html", + reportName : "Integration Test Report" + ] + } + } + } + + afterAlways('DependencyCheckNightly') { + publishHTML([ + allowMissing : true, + alwaysLinkToLastBuild: true, + keepAll : true, + reportDir : "build/reports", + reportFiles : 'dependency-check-report.html', + reportName : 'Dependency Check Report' + ]) + } + }