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
+
1
3
pipeline {
2
- agent {
3
- label ' qa_terminating_j8'
4
- }
4
+ agent none
5
+
5
6
6
7
options {
7
- disableConcurrentBuilds ()
8
+ skipDefaultCheckout ()
8
9
}
9
10
10
11
environment {
11
12
registryCredential = ' jenkins-artifactory'
12
13
ARTIFACTORY_URL = ' docker.internal.sysdig.com'
13
14
EXPORTER = ' postgresql-exporter'
14
- VERSION = ' 0.9.0'
15
15
}
16
16
17
17
stages {
18
18
stage(' Pull image from artifactory' ) {
19
+ agent any
19
20
steps {
20
21
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} "
22
26
sh """ docker pull ${ env.ARTIFACTORY_URL} /${ env.EXPORTER} :${ env.VERSION} """
23
27
sh """ docker pull ${ env.ARTIFACTORY_URL} /${ env.EXPORTER} :${ env.VERSION} -ubi"""
24
28
}
25
29
}
26
30
}
27
31
}
28
32
stage(' Push image to Quay' ){
33
+ agent any
29
34
steps {
30
35
script {
31
36
docker. withRegistry(" https://quay.io" , " QUAY" ) {
@@ -39,5 +44,10 @@ pipeline {
39
44
}
40
45
}
41
46
}
47
+ } // stages
48
+ post {
49
+ cleanup {
50
+ cleanWs()
51
+ } // post
42
52
}
43
53
}
You can’t perform that action at this time.
0 commit comments