Skip to content

Commit

Permalink
adding profile jar-signing to pipeline file
Browse files Browse the repository at this point in the history
  • Loading branch information
skublik committed Jan 26, 2024
1 parent ee184d2 commit cea0abc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 51 deletions.
Binary file removed gui/admin-gui/src/main/resources/jar-signing.cer
Binary file not shown.
76 changes: 25 additions & 51 deletions tools/jenkins/midpoint-main-pipeline
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ podTemplate(
resourceRequestCpu: params.BUILDER_CPU ?: '4',
resourceLimitCpu: params.BUILDER_CPU ?: '4',
resourceRequestMemory: '8Gi',
resourceLimitMemory: '8Gi') // see also -Xmx flag lower
resourceLimitMemory: '8Gi',
envVars: [
envVar(key: MIDPOINT_BUILD_ALIAS, value: params.KEY_ALIAS_SINGING_JAR)
]) // see also -Xmx flag lower
]
) {
node(POD_LABEL) {
Expand All @@ -41,60 +44,31 @@ podTemplate(
}
stage("build") {
container('maven') {
sh """#!/bin/bash -ex
# .m2 is mutable and short-term, we just sym-link the settings.xml there.
mkdir -p /root/.m2
ln -s ../jenkins-nexus/settings.xml /root/.m2/settings.xml
withCredentials(
[string(credentialsId: '4e3b82aa-6cdf-4e91-ae3c-fd5240ba3072', variable: 'MIDPOINT_BUILD_STOREPASS'),
string(credentialsId: '4e3b82aa-6cdf-4e91-ae3c-fd5240ba3072', variable: 'MIDPOINT_BUILD_KEYPASS'),
string(credentialsId: 'build keystore test', variable: 'MIDPOINT_BUILD_KEYSTORE')
]) {
sh """#!/bin/bash -ex
# .m2 is mutable and short-term, we just sym-link the settings.xml there.
mkdir -p /root/.m2
ln -s ../jenkins-nexus/settings.xml /root/.m2/settings.xml

if [ "${verbose}" -ge 1 ]; then
env | sort
mvn --version
df -h
fi
if [ "${verbose}" -ge 1 ]; then
env | sort
mvn --version
df -h
fi

mvn -B -ntp -DskipTests clean ${params.SKIP_DEPLOY ? 'install' : 'deploy -DdeployAtEnd=true'}
mvn -B -ntp -DskipTests clean ${params.SKIP_DEPLOY ? 'install' : 'deploy -DdeployAtEnd=true'} -P jar-signing

if [ "${verbose}" -ge 1 ]; then
df -h
fi
"""
}
}
stage("tests-default") {
container('maven') {
sh """#!/bin/bash -ex
mvn -B -ntp -Dmaven.test.failure.ignore verify

if [ "${verbose}" -ge 1 ]; then
df -h
fi
"""
}
}
stage("tests-extra") {
container('maven') {
// -Xmx6g should fit into 8GB of RAM, 4g is on the edge for some tests
sh """#!/bin/bash -ex
mvn -B -ntp -Dmaven.test.failure.ignore verify -P extratest,-dist -Dfailsafe.args="-Xms2g -Xmx6g -Duser.language=en --add-exports java.management/sun.management=ALL-UNNAMED" -rf testing

if [ "${verbose}" -ge 1 ]; then
df -h
fi
"""

// If we get here it's success, test results can change it to UNSTABLE.
currentBuild.result = 'SUCCESS'

// Collects results for all tests (main + extra).
// Using this step in each phase produces multiple graphs, but all have the same results from the last run.
step([$class: 'Publisher',
reportFilenamePattern: '**/testng-results.xml',
failureOnFailedTestConfig: true // TODO we don't want failure, but how can we make it unstable?
])
// If we get here it's success, test results can change it to UNSTABLE.
currentBuild.result = 'SUCCESS'

if (currentBuild.result == 'UNSTABLE' || currentBuild.result == 'FAILURE' || params.ARCHIVE_LOGS) {
sh "find . -wholename '*/target/test.log' -print0 | tar -czf test-logs.tgz --null -T -"
archiveArtifacts allowEmptyArchive: true, artifacts: "test-logs.tgz", followSymlinks: false
if [ "${verbose}" -ge 1 ]; then
df -h
fi
"""
}
}
}
Expand Down

0 comments on commit cea0abc

Please sign in to comment.