Skip to content

Commit

Permalink
Jenkins: build tarball in Docker container
Browse files Browse the repository at this point in the history
Due to build issues with libldtl and/or Autotools in Ubuntu:22.04,
perform the build within a Docker container running Ubuntu:18.04.
  • Loading branch information
micahsnyder committed Aug 29, 2024
1 parent 71ba09e commit 2a6f20f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
6 changes: 6 additions & 0 deletions Jenkins/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM ubuntu:18.04

RUN apt-get update && apt-get install -y \
gcc make automake autoconf m4 pkg-config libtool flex bison valgrind \
check libbz2-dev libcurl4-openssl-dev libjson-c-dev libmilter-dev \
libncurses5-dev libpcre2-dev libssl-dev libxml2-dev zlib1g-dev
27 changes: 19 additions & 8 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ properties(
]
)

node('default') {
node('docker') {
stage('Generate Tarball') {
cleanWs()

Expand All @@ -72,13 +72,24 @@ node('default') {
'''
}

dir(path: 'build') {
sh """# Make Dist
if [ -f '../autogen.sh' ] ; then /bin/chmod +x ../autogen.sh && ../autogen.sh ; fi
../configure --enable-milter --disable-clamav --disable-silent-rules --enable-llvm --with-system-llvm=no
make distcheck
mv clamav-${params.VERSION}*.tar.gz clamav-${params.VERSION}.tar.gz || true"""
archiveArtifacts(artifacts: "clamav-${params.VERSION}.tar.gz", onlyIfSuccessful: true)
// start up docker image
def dockerImage = docker.build("autoconf", "./Jenkins")

try {
dockerImage.inside("-u root --privileged") { c ->
dir(path: "build") {
sh """# Make Dist
if [ -f '../autogen.sh' ] ; then /bin/chmod +x ../autogen.sh && ../autogen.sh ; fi
../configure --enable-milter --disable-clamav --disable-silent-rules --enable-llvm --with-system-llvm=no
make distcheck
mv clamav-${params.VERSION}*.tar.gz clamav-${params.VERSION}.tar.gz || true"""
archiveArtifacts(artifacts: "clamav-${params.VERSION}.tar.gz", onlyIfSuccessful: true)
}
}
}
catch(IOException err) {
cleanWs()
throw err
}

cleanWs()
Expand Down

0 comments on commit 2a6f20f

Please sign in to comment.