debian/Jenkinsfile

59 lines
1.7 KiB
Text
Raw Normal View History

2020-05-28 11:02:04 +00:00
gosu_version = "1.12"
dumb_init_version = "1.2.2"
timeStamp = Calendar.getInstance().getTime().format('YYYY-MM-dd',TimeZone.getTimeZone('UTC'))
pipeline {
agent any
stages {
stage('Build image') {
steps {
withDockerRegistry([ credentialsId: "6ff44976-23cd-4cc2-902c-de8c340e65e5", url: "https://reg.zknt.org" ]) {
script {
def customImage = docker.build("reg.zknt.org/zknt/debian", "--build-arg DATE=$timeStamp --build-arg GOSU_VERSION=$gosu_version --build-arg DUMB_INIT_VERSION=$dumb_init_version --no-cache --pull .")
customImage.push("buster")
customImage.push("stable")
customImage.push("10")
registry_credentials = "3deeee3d-6fce-4430-98dd-9b4db56f43f7"
withDockerRegistry([ credentialsId: registry_credentials ]) {
def official_image = 'zknt/debian:buster'
sh "docker image tag reg.zknt.org/zknt/debian:buster " + official_image
sh "docker push " + official_image
}
}
}
}
}
}
post {
always {
2020-05-28 11:28:38 +00:00
emailext body: 'build finished', subject: '[jenkins] docker debian: ' + currentBuild.result, to: 'cg@zknt.org', from: 'sysadm@zknt.org', attachLog: true
2020-05-28 11:02:04 +00:00
}
}
options {
buildDiscarder(BuildHistoryManager([
[
conditions: [
BuildResult(matchFailure: true)
],
matchAtMost: 4,
continueAfterMatch: false
],
[
conditions: [
BuildResult(matchSuccess: true)
],
matchAtMost: 2,
continueAfterMatch: false
],
[
conditions: [
BuildResult(matchSuccess: true, matchFailure: true)
],
actions: [DeleteBuild()]
]
]))
}
}