-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
64 lines (56 loc) · 1.78 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
properties([
disableConcurrentBuilds(),
buildDiscarder(logRotator(numToKeepStr: '10', daysToKeepStr: '30'))
])
def platforms = [:]
def packagePlatforms = ["jammy", "noble"]
for (int i = 0; i < packagePlatforms.size(); i++) {
def platform = packagePlatforms[i]
platforms["package-$platform"] = { -> node('docker') {
stage("package-$platform") { timeout(time: 3, unit: 'HOURS') {
checkout scm
sh 'git submodule foreach git fetch --tags --force'
withCredentials([file(credentialsId: 'gpg-sign-key', variable: 'SECRET')]) {
sh 'cp $SECRET secret.gpg'
}
def img = docker.build("flatironinstitute/triqs-package-$platform:${env.BRANCH_NAME}", "-f Dockerfile.package-$platform .")
img.inside('-v /etc/passwd:/etc/passwd -v /etc/group:/etc/group') {
sh """#!/bin/bash -ex
top=\$PWD
for t in triqs triqs_cthyb triqs_ctseg triqs_dft_tools triqs_tprf triqs_maxent triqs_hubbardI triqs_hartree_fock solid_dmft triqs_Nevanlinna ; do
mkdir \$top/test/\$t/run
cd \$top/test/\$t/run
cmake ..
make -j2
make test CTEST_OUTPUT_ON_FAILURE=1
done
"""
sh "tar czf ${platform}.tgz -C \$REPO ."
}
sh "docker rmi --no-prune ${img.imageName()}"
archiveArtifacts(artifacts: "${platform}.tgz")
} }
} }
}
try {
parallel platforms
} catch (err) {
emailext(
subject: "\$PROJECT_NAME - Build # \$BUILD_NUMBER - FAILED",
body: """\$PROJECT_NAME - Build # \$BUILD_NUMBER - FAILED
$err
Check console output at \$BUILD_URL to view full results.
Building \$BRANCH_NAME for \$CAUSE
\$JOB_DESCRIPTION
Chages:
\$CHANGES
End of build log:
\${BUILD_LOG,maxLines=60}
""",
to: 'nwentzell@flatironinstitute.org, dsimon@flatironinstitute.org',
recipientProviders: [
],
replyTo: '$DEFAULT_REPLYTO'
)
throw err
}