Skip to content

Commit

Permalink
Merge branch 'release/4.3.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
olliefreeman committed Mar 26, 2021
2 parents 9209f18 + e73bbff commit ac003db
Show file tree
Hide file tree
Showing 268 changed files with 8,575 additions and 2,402 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
hs_err_pid*

.gradle
/build/
build/

# Ignore Gradle GUI config
gradle-app.setting
Expand Down
80 changes: 69 additions & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ pipeline {
// timeout(time: 45, unit: 'MINUTES')
// skipStagesAfterUnstable()
buildDiscarder(logRotator(numToKeepStr: '30'))
disableConcurrentBuilds()
throttleJobProperty(
categories: ['mdm-core'],
throttleEnabled: true,
throttleOption: 'category'
)
}

stages {
Expand Down Expand Up @@ -63,6 +69,13 @@ pipeline {
}
}

// If the flyway is broken then do NOT deploy to artifactory
stage('Flyway Migration Check') {
steps {
sh './gradlew --build-cache verifyFlywayMigrationVersions'
}
}

// Deploy develop branch even if tests fail if the code builds, as it'll be an unstable snapshot but we should still deploy
stage('Deploy develop to Artifactory') {
when {
Expand Down Expand Up @@ -107,10 +120,11 @@ pipeline {
'mdm-plugin-dataflow',
'mdm-plugin-datamodel',
'mdm-plugin-email-proxy',
// 'mdm-plugin-profile',
'mdm-plugin-referencedata',
'mdm-plugin-terminology',
'mdm-security',
].collect { ":${it}:integrationTest" }.join(' ')
].collect {":${it}:integrationTest"}.join(' ')
}
post {
always {
Expand All @@ -124,7 +138,7 @@ pipeline {
*/
stage('Functional Test: mdm-core') {
steps {
sh "./gradlew -Dgrails.functionalTest=true :mdm-core:integrationTest"
sh "./gradlew -Dgradle.functionalTest=true :mdm-core:integrationTest"
}
post {
always {
Expand All @@ -134,7 +148,7 @@ pipeline {
}
stage('Functional Test: mdm-plugin-authentication-apikey') {
steps {
sh "./gradlew -Dgrails.functionalTest=true :mdm-plugin-authentication-apikey:integrationTest"
sh "./gradlew -Dgradle.functionalTest=true :mdm-plugin-authentication-apikey:integrationTest"
}
post {
always {
Expand All @@ -144,7 +158,7 @@ pipeline {
}
stage('Functional Test: mdm-plugin-authentication-basic') {
steps {
sh "./gradlew -Dgrails.functionalTest=true :mdm-plugin-authentication-basic:integrationTest"
sh "./gradlew -Dgradle.functionalTest=true :mdm-plugin-authentication-basic:integrationTest"
}
post {
always {
Expand All @@ -154,7 +168,7 @@ pipeline {
}
stage('Functional Test: mdm-plugin-dataflow') {
steps {
sh "./gradlew -Dgrails.functionalTest=true :mdm-plugin-dataflow:integrationTest"
sh "./gradlew -Dgradle.functionalTest=true :mdm-plugin-dataflow:integrationTest"
}
post {
always {
Expand All @@ -164,7 +178,7 @@ pipeline {
}
stage('Functional Test: mdm-plugin-datamodel') {
steps {
sh "./gradlew -Dgrails.functionalTest=true :mdm-plugin-datamodel:integrationTest"
sh "./gradlew -Dgradle.functionalTest=true :mdm-plugin-datamodel:integrationTest"
}
post {
always {
Expand All @@ -174,7 +188,7 @@ pipeline {
}
stage('Functional Test: mdm-plugin-referencedata') {
steps {
sh "./gradlew -Dgrails.functionalTest=true :mdm-plugin-referencedata:integrationTest"
sh "./gradlew -Dgradle.functionalTest=true :mdm-plugin-referencedata:integrationTest"
}
post {
always {
Expand All @@ -184,7 +198,7 @@ pipeline {
}
stage('Functional Test: mdm-plugin-terminology') {
steps {
sh "./gradlew -Dgrails.functionalTest=true :mdm-plugin-terminology:integrationTest"
sh "./gradlew -Dgradle.functionalTest=true :mdm-plugin-terminology:integrationTest"
}
post {
always {
Expand All @@ -194,14 +208,24 @@ pipeline {
}
stage('Functional Test: mdm-security') {
steps {
sh "./gradlew -Dgrails.functionalTest=true :mdm-security:integrationTest"
sh "./gradlew -Dgradle.functionalTest=true :mdm-security:integrationTest"
}
post {
always {
junit allowEmptyResults: true, testResults: 'mdm-security/build/test-results/functionalTest/*.xml'
}
}
}
stage('Functional Test: mdm-plugin-profile') {
steps {
sh "./gradlew -Dgradle.functionalTest=true :mdm-plugin-profile:integrationTest"
}
post {
always {
junit allowEmptyResults: true, testResults: 'mdm-plugin-profile/build/test-results/functionalTest/*.xml'
}
}
}

/*
E2E Functional Tests
Expand Down Expand Up @@ -276,6 +300,16 @@ pipeline {
}
}
}
// stage('E2E Profile Functional Test') {
// steps {
// sh "./gradlew -Dgradle.test.package=profile :mdm-testing-functional:integrationTest"
// }
// post {
// always {
// junit allowEmptyResults: true, testResults: 'mdm-testing-functional/build/test-results/profile/*.xml'
// }
// }
// }

stage('Compile complete Test Report') {
steps {
Expand All @@ -296,10 +330,27 @@ pipeline {
}
}

stage('Static Code Analysis') {
steps {
sh "./gradlew -PciRun=true staticCodeAnalysis jacocoTestReport"
}
}

stage('Sonarqube') {
when {
branch 'develop'
}
steps {
withSonarQubeEnv('JenkinsQube') {
sh "./gradlew sonarqube"
}
}
}

stage('Deploy master to Artifactory') {
when {
allOf {
branch 'master'
branch 'main'
expression {
currentBuild.currentResult == 'SUCCESS'
}
Expand All @@ -315,8 +366,15 @@ pipeline {

post {
always {
recordIssues enabledForFailure: true, tools: [java(), javaDoc()]
recordIssues enabledForFailure: true, tool: checkStyle(pattern: '**/reports/checkstyle/*.xml')
recordIssues enabledForFailure: true, tool: codeNarc(pattern: '**/reports/codenarc/*.xml')
recordIssues enabledForFailure: true, tool: spotBugs(pattern: '**/reports/spotbugs/*.xml', useRankAsPriority: true)
recordIssues enabledForFailure: true, tool: pmdParser(pattern: '**/reports/pmd/*.xml')

publishCoverage adapters: [jacocoAdapter('**/reports/jacoco/jacocoTestReport.xml')]
outputTestResults()
jacoco execPattern: '**/build/jacoco/*.exec'
jacoco classPattern: '**/build/classes', execPattern: '**/build/jacoco/*.exec', sourceInclusionPattern: '**/*.java,**/*.groovy', sourcePattern: '**/src/main/groovy,**/grails-app/controllers,**/grails-app/domain,**/grails-app/services,**/grails-app/utils'
archiveArtifacts allowEmptyArchive: true, artifacts: '**/*.log'
slackNotification()
}
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ plugins {
id 'maven'
id "com.jfrog.artifactory" version "4.15.2"
id 'maven-publish'
id "org.sonarqube" version "3.1.1"
}

apply plugin: 'ox.softeng.ox-brc-base'
Expand Down
7 changes: 4 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Core Info
version=4.2.0
version=4.3.0
group=uk.ac.ox.softeng.maurodatamapper
# Gradle
gradleVersion=6.7.1
Expand All @@ -10,8 +10,8 @@ sourceCompatibility=12
targetCompatibility=12
# Deployment & Build
artifactory_contextUrl=https://jenkins.cs.ox.ac.uk/artifactory
oxbrcinformaticsGradlePluginsVersion=3.10
licenseGradlePluginVersion:0.15.0
oxbrcinformaticsGradlePluginsVersion=3.13
licenseGradlePluginVersion=0.15.0
licenseGradlePluginSpringCoreOverrideVersion=5.1.14.RELEASE
## Grails
grailsVersion=4.0.6
Expand All @@ -31,6 +31,7 @@ antVersion=1.9.13
javaMailVersion=5.4.0
xmlunitVersion=2.6.2
commonsBeanutilsVersion=1.9.4
spotbugsAnnotationVersion=4.2.1
## Security
commonsRngVersion=1.3
grailsUtilsVersion=3.3.3
Expand Down
Loading

0 comments on commit ac003db

Please sign in to comment.