redo versioning
This commit is contained in:
parent
21399dc913
commit
783b0e48f1
|
@ -1,19 +1,31 @@
|
|||
project = "alpine"
|
||||
repo = "zknt"
|
||||
version = "3.10.2"
|
||||
registry = "reg.zknt.org"
|
||||
registry_credentials = "6ff44976-23cd-4cc2-902c-de8c340e65e5"
|
||||
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage('Build image') {
|
||||
steps {
|
||||
withDockerRegistry([ credentialsId: "6ff44976-23cd-4cc2-902c-de8c340e65e5", url: "https://reg.zknt.org" ]) {
|
||||
withDockerRegistry([ credentialsId: registry_credentials, url: "https://"+registry ]) {
|
||||
echo 'Starting to build docker image'
|
||||
script {
|
||||
def customImage = docker.build("reg.zknt.org/zknt/alpine", "--build-arg VERSION=$env.BRANCH_NAME .")
|
||||
customImage.push(env.BRANCH_NAME)
|
||||
customImage.push(env.BRANCH_NAME.split(/\./)[0,1].join('.'))
|
||||
customImage.push(env.BRANCH_NAME.split(/\./)[0])
|
||||
def customImage = docker.build(registry+'/'+repo+'/'+project, "--build-arg VERSION=$version .")
|
||||
customImage.push(version)
|
||||
customImage.push(version.split(/\./)[0,1].join('.'))
|
||||
customImage.push(version.split(/\./)[0])
|
||||
customImage.push("latest")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
emailext body: 'build finished', subject: '[jenkins] docker '+project+': ' + currentBuild.result, to: 'cg@zknt.org', from: 'sysadm@zknt.org', attachLog: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue