Skip to content

Commit

Permalink
added new midpoint-compile-pipeline for compile-only build
Browse files Browse the repository at this point in the history
It is shorter and can start much more often, possibly in parallel.
  • Loading branch information
virgo47 committed Jun 20, 2022
1 parent 54a714d commit e6377ca
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 15 deletions.
81 changes: 81 additions & 0 deletions tools/jenkins/midpoint-compile-pipeline
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
* Copyright (C) 2010-2022 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
*/

def verbose = params.VERBOSE ?: '0'

podTemplate(
activeDeadlineSeconds: 900,
idleMinutes: 1,
workspaceVolume: dynamicPVC(requestsSize: "10Gi"),
containers: [
containerTemplate(name: 'jnlp',
image: 'jenkins/inbound-agent:4.13-2-alpine',
runAsUser: '0',
resourceRequestCpu: '1',
resourceLimitCpu: '1',
resourceRequestMemory: '1Gi',
resourceLimitMemory: '1Gi'),
containerTemplate(name: 'maven',
image: params.BUILDER_IMAGE ?: 'maven:3.8.5-openjdk-11',
runAsUser: '0',
ttyEnabled: true,
command: 'cat',
resourceRequestCpu: params.BUILDER_CPU ?: '4',
resourceLimitCpu: params.BUILDER_CPU ?: '4',
resourceRequestMemory: '4Gi',
resourceLimitMemory: '4Gi')
]
) {
node(POD_LABEL) {
try {
stage("checkout") {
sh """#!/bin/bash -ex
if [ "${verbose}" -ge 1 ]
then
df -h
fi
"""
git branch: params.BRANCH ?: 'master',
url: 'https://github.com/Evolveum/midpoint.git'
}
stage("compile") {
container('maven') {
sh """#!/bin/bash -ex
if [ "${verbose}" -ge 1 ]
then
id
env | sort
mvn --version
fi

mvn -B -ntp -U clean package -DskipTests -P -dist
"""
}
}
} catch (Exception e) {
currentBuild.result = 'FAILURE' // error below will not set result for mailer!
error "Marking build as FAILURE because of: ${e}"
} finally {
try {
// Very basic mails, later we can use https://plugins.jenkins.io/email-ext/
step([$class: 'Mailer',
notifyEveryUnstableBuild: true,
recipients: env.DEFAULT_MAIL_RECIPIENT,
sendToIndividuals: false])

sh """#!/bin/bash -ex
if [ "${verbose}" -ge 1 ]
then
df -h
fi
"""
} catch (Exception e) {
println 'Could not send email: ' + e
}
}
}
}
16 changes: 1 addition & 15 deletions tools/jenkins/midpoint-quick-pipeline
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,6 @@ podTemplate(
git branch: params.BRANCH ?: 'master',
url: 'https://github.com/Evolveum/midpoint.git'
}
stage("compile") {
container('maven') {
sh """#!/bin/bash -ex
if [ "${verbose}" -ge 1 ]
then
id
env | sort
mvn --version
fi

mvn -B -ntp -U clean package -DskipTests -P -dist
"""
}
}
stage("build") {
container('maven') {
sh """#!/bin/bash -ex
Expand All @@ -69,7 +55,7 @@ podTemplate(
mvn --version
fi

mvn -B -ntp -U -Dmaven.test.failure.ignore verify -P -dist -DintegrationTestSuite=fast
mvn -B -ntp -U -Dmaven.test.failure.ignore clean install -P -dist -DintegrationTestSuite=fast

if [ "${verbose}" -ge 1 ]
then
Expand Down

0 comments on commit e6377ca

Please sign in to comment.