Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 4 additions & 76 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,6 @@ pipeline {
defaultValue: false,
description: 'Check this to prepare a new release (creates pre-release branch and PR)'
)
booleanParam(
name: 'SKIP_TESTS',
defaultValue: false,
description: 'Skip unit tests and integration tests'
)
booleanParam(
name: 'SKIP_CHECKS',
defaultValue: false,
description: 'Skip coverage and SonarQube analysis'
)
}

stages {
Expand All @@ -69,79 +59,17 @@ pipeline {
}
}

stage('Build jar') {
stage('Maven') {
steps {
script {
def profile = '-P dev'
if (env.TAG_NAME) {
profile = '-P prod'
}
container('jdk-21') {
sh """
mvn -B clean package ${profile}
cp boot/target/carbonio-docs-connector-*-fatjar.jar package/carbonio-docs-connector.jar
"""
}
}
}
}

stage('Unit tests') {
when {
expression { params.SKIP_TESTS == false }
}
steps {
container('jdk-21') {
sh 'mvn -B verify -P run-unit-tests'
}
}
}

stage('Integration tests') {
when {
expression { params.SKIP_TESTS == false }
}
steps {
container('jdk-21') {
sh 'mvn -B verify -P run-integration-tests'
}
}
}

stage('Coverage') {
when {
expression { params.SKIP_CHECKS == false }
}
steps {
container('jdk-21') {
sh 'mvn -B verify -P generate-jacoco-full-report'
recordCoverage(
tools: [[parser: 'JACOCO']],
sourceCodeRetention: 'MODIFIED'
mavenStage(
splitTests: true,
Comment thread
gjed marked this conversation as resolved.
postBuildScript: 'cp boot/target/carbonio-docs-connector-*-fatjar.jar package/carbonio-docs-connector.jar'
)
}
}
}

stage('SonarQube analysis') {
when {
allOf {
expression { params.SKIP_CHECKS == false }
anyOf {
branch 'devel'
expression { env.BRANCH_NAME.contains("PR") }
}
}
}
steps {
container('jdk-21') {
withSonarQubeEnv(credentialsId: 'sonarqube-user-token', installationName: 'SonarQube instance') {
sh 'mvn -B sonar:sonar'
}
}
}
}

stage('Build deb/rpm') {
steps {
script {
Expand Down