97 lines
3.2 KiB
Plaintext
97 lines
3.2 KiB
Plaintext
pipeline {
|
|
agent any
|
|
// triggers {
|
|
// cron("@weekly")
|
|
// }
|
|
options {
|
|
timestamps()
|
|
ansiColor("xterm")
|
|
disableConcurrentBuilds()
|
|
skipDefaultCheckout()
|
|
}
|
|
stages {
|
|
stage('checkout') {
|
|
steps {
|
|
checkout scm
|
|
|
|
checkout([
|
|
$class: 'GitSCM',
|
|
branches: [[name: 'refs/heads/master']],
|
|
extensions: [[
|
|
$class: 'RelativeTargetDirectory',
|
|
relativeTargetDir: 'mergerfs'
|
|
]],
|
|
doGenerateSubmoduleConfigurations: false,
|
|
userRemoteConfigs: [[
|
|
url: 'https://github.com/trapexit/mergerfs.git'
|
|
]],
|
|
])
|
|
|
|
}
|
|
}
|
|
|
|
stage ('ubuntu:latest (lts)') {
|
|
steps {
|
|
sh "docker build --pull -f Dockerfile --build-arg BASE_IMAGE=ubuntu:latest --target builder -t mergerfs:build-ubuntu-latest ."
|
|
sh "docker container create --name m_ubuntu_latest mergerfs:build-ubuntu-latest"
|
|
sh "docker container cp m_ubuntu_latest:/mergerfs/deb/ ."
|
|
|
|
}
|
|
}
|
|
|
|
stage ('ubuntu:21.04') {
|
|
steps {
|
|
sh "docker build --pull -f Dockerfile --build-arg BASE_IMAGE=ubuntu:21.04 --target builder -t mergerfs:build-ubuntu-2104 ."
|
|
sh "docker container create --name m_ubuntu_2104 mergerfs:build-ubuntu-2104"
|
|
sh "docker container cp m_ubuntu_2104:/mergerfs/deb/ ."
|
|
|
|
}
|
|
}
|
|
stage ('debian:bullseye') {
|
|
steps {
|
|
sh "docker build --pull -f Dockerfile --build-arg BASE_IMAGE=debian:bullseye --target builder -t mergerfs:build-debian-bullseye ."
|
|
sh "docker container create --name m_debian_bullseye mergerfs:build-debian-bullseye"
|
|
sh "docker container cp m_debian_bullseye:/mergerfs/deb/ ."
|
|
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
post {
|
|
success {
|
|
script {
|
|
findFiles(glob: "deb/*.deb").each { debfile ->
|
|
echo debfile.name
|
|
archiveArtifacts(artifacts: "deb/${debfile.name}", fingerprint: true)
|
|
|
|
sh "cp deb/${debfile.name} ${env.JENKINS_HOME}/artifacts"
|
|
|
|
build(
|
|
job: "/utils/apt",
|
|
wait: true,
|
|
propagate: true,
|
|
parameters: [[
|
|
$class: 'StringParameterValue',
|
|
name: 'filename',
|
|
value: "${debfile.name}" ]])
|
|
}
|
|
}
|
|
}
|
|
cleanup {
|
|
script {
|
|
sh "docker container rm m_ubuntu_latest || true"
|
|
sh "docker container rm m_ubuntu_2104 || true"
|
|
sh "docker container rm m_debian_bullseye || true"
|
|
sh "rm -f /mergerfs/deb/deb.txt || true"
|
|
}
|
|
cleanWs(
|
|
deleteDirs: true,
|
|
disableDeferredWipeout: true,
|
|
notFailBuild: true
|
|
)
|
|
}
|
|
|
|
}
|
|
}
|