Skip to content

Commit b1f52c2

Browse files
committed
Fix the jenkinsfile
1 parent dd40240 commit b1f52c2

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

build/Jenkinsfile

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,36 @@
1+
string projectName = "prometheus-integrations"
2+
13
pipeline {
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
}

0 commit comments

Comments
 (0)