add docker release stage to pipeline
Some checks failed
mapguesser/pipeline/pr-develop There was a failure building this commit
Some checks failed
mapguesser/pipeline/pr-develop There was a failure building this commit
This commit is contained in:
parent
bbb878ae07
commit
f85d91e1ba
22
Jenkinsfile
vendored
22
Jenkinsfile
vendored
@ -61,5 +61,27 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stage('Release Docker image') {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
sh script 'git clean -ffdx', label 'Clean repository'
|
||||||
|
|
||||||
|
def version = sh(script: 'git describe --tags --always --match "Release_*" HEAD', returnStdout: true).trim()
|
||||||
|
def imageUrl = "git.esoko.eu/esoko/mapguesser:${version}"
|
||||||
|
|
||||||
|
sh script: """docker buildx build \
|
||||||
|
-t ${imageUrl} \
|
||||||
|
-f docker/Dockerfile \
|
||||||
|
--target mapg_release \
|
||||||
|
.""",
|
||||||
|
label: 'Build Docker image')
|
||||||
|
|
||||||
|
withDockerRegistry([credentialsId: 'gitea-system-user', url: 'https://git.esoko.eu/']) {
|
||||||
|
sh script: "docker push ${image_url}", label: 'Push Docker image to registry'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user