File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change 1+ string projectName = " prometheus-integrations"
2+
13pipeline {
2- agent {
3- label ' qa_terminating_j8'
4- }
4+ agent none
5+
56
67 options {
7- disableConcurrentBuilds ()
8+ skipDefaultCheckout ()
89 }
910
1011 environment {
1112 registryCredential = ' jenkins-artifactory'
1213 ARTIFACTORY_URL = ' docker.internal.sysdig.com'
1314 EXPORTER = ' postgresql-exporter'
14- VERSION = ' 0.9.0'
1515 }
1616
1717 stages {
1818 stage(' Pull image from artifactory' ) {
19+ agent any
1920 steps {
2021 script {
21- docker. withRegistry(" https://${ env.ARTIFACTORY_URL} " , registryCredential) {
22+ docker. withRegistry(" https://${ env.ARTIFACTORY_URL} " , registryCredential) {
23+ sh """ docker pull ${ env.ARTIFACTORY_URL} /${ env.EXPORTER} :latest"""
24+ env. VERSION = sh(script :""" docker inspect --format '{{ index .Config.Labels "release" }}' ${ env.ARTIFACTORY_URL} /${ env.EXPORTER} :latest""" , returnStdout : true ). trim()
25+ echo " VERSION = ${ env.VERSION} "
2226 sh """ docker pull ${ env.ARTIFACTORY_URL} /${ env.EXPORTER} :${ env.VERSION} """
2327 sh """ docker pull ${ env.ARTIFACTORY_URL} /${ env.EXPORTER} :${ env.VERSION} -ubi"""
2428 }
2529 }
2630 }
2731 }
2832 stage(' Push image to Quay' ){
33+ agent any
2934 steps {
3035 script {
3136 docker. withRegistry(" https://quay.io" , " QUAY" ) {
@@ -39,5 +44,10 @@ pipeline {
3944 }
4045 }
4146 }
47+ } // stages
48+ post {
49+ cleanup {
50+ cleanWs()
51+ } // post
4252 }
4353}
You can’t perform that action at this time.
0 commit comments