Skip to content

Commit 9fca506

Browse files
committed
Refactor Jenkinsfile to improve build and test stages with updated commands and options
1 parent 2270aba commit 9fca506

2 files changed

Lines changed: 8 additions & 11 deletions

File tree

debian/Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ distributions.each { distro ->
4949
sh 'dch -b -v ' + buildVer + ' "' + env.BUILD_TAG + '"'
5050
sh 'sudo apt-get update --allow-releaseinfo-change'
5151
sh 'sudo chown jenkins:jenkins ..'
52-
sh 'debuild-pbuilder -i -us -uc -b'
52+
sh 'debuild-pbuilder -r"sudo -E" -i -us -uc -b'
5353
sh 'mkdir -p $WORKSPACE/dist/debian/ ; rm -rf $WORKSPACE/dist/debian/* ; for deb in $(cat debian/files | awk \'{print $1}\'); do mv "../$deb" $WORKSPACE/dist/debian/; done'
5454
artifacts = sh (
5555
script: "cat debian/files | awk '{print \$1}'",
@@ -66,7 +66,7 @@ distributions.each { distro ->
6666
sh 'sudo apt-get update --allow-releaseinfo-change'
6767
sh 'echo "INSTALATION"'
6868

69-
// Ensure multiflexi-sqlite is first in the list
69+
// Ensure abraflexi-webhook-acceptor-sqlite is first in the list
7070
def installOrder = [
7171
'multiflexi-sqlite',
7272
]

debian/Jenkinsfile.release

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!groovy
22

3-
// Current version of this Pipeline https://raw.githubusercontent.com/VitexSoftware/multiflexi-buildimages/refs/heads/main/Test/multiflexi-halloworld/Jenkinsfile
4-
53
String[] distributions = ['debian:bookworm', 'debian:trixie', 'debian:forky', 'ubuntu:jammy', 'ubuntu:noble']
64

75
String vendor = 'vitexsoftware'
@@ -45,11 +43,11 @@ distributions.each { distro ->
4543
buildVer = version + '.' + env.BUILD_NUMBER + '~' + distroCode
4644
}
4745
stage('Build ' + distroName) {
48-
buildImage.inside {
46+
buildImage.inside('--ipc=host') {
4947
sh 'dch -b -v ' + buildVer + ' "' + env.BUILD_TAG + '"'
5048
sh 'sudo apt-get update --allow-releaseinfo-change'
51-
sh 'sudo chown jenkins:jenkins ..'
52-
sh 'debuild-pbuilder -i -us -uc -b'
49+
sh 'sudo chown -R jenkins:jenkins . ..'
50+
sh 'debuild-pbuilder -r"sudo -E" -i -us -uc -b'
5351
sh 'mkdir -p $WORKSPACE/dist/debian/ ; rm -rf $WORKSPACE/dist/debian/* ; for deb in $(cat debian/files | awk \'{print $1}\'); do mv "../$deb" $WORKSPACE/dist/debian/; done'
5452
artifacts = sh (
5553
script: "cat debian/files | awk '{print \$1}'",
@@ -59,8 +57,8 @@ distributions.each { distro ->
5957
}
6058

6159
stage('Test ' + distroName) {
62-
buildImage.inside {
63-
def debconf_debug = 5 //Set to "5" or "developer" to debug debconf
60+
buildImage.inside('--ipc=host') {
61+
def debconf_debug = 0 //Set to "5" or "developer" to debug debconf
6462
sh 'cd $WORKSPACE/dist/debian/ ; dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz; cd $WORKSPACE'
6563
sh 'echo "deb [trusted=yes] file://///$WORKSPACE/dist/debian/ ./" | sudo tee /etc/apt/sources.list.d/local.list'
6664
sh 'sudo apt-get update --allow-releaseinfo-change'
@@ -79,13 +77,12 @@ distributions.each { distro ->
7977
}
8078
stage('Archive artifacts ' + distroName ) {
8179
// Only run if previous stages (Build and Test) succeeded
82-
buildImage.inside {
80+
buildImage.inside('--ipc=host') {
8381
// Archive all produced artifacts listed in debian/files
8482
artifacts.each { deb_file ->
8583
println "Archiving artifact: " + deb_file
8684
archiveArtifacts artifacts: 'dist/debian/' + deb_file
8785
}
88-
8986
// Cleanup: remove any produced files named in debian/files
9087
// Try both the dist location and any potential original locations referenced by debian/files
9188
sh '''

0 commit comments

Comments
 (0)