@@ -21,44 +21,28 @@ pipeline {
21
21
'''
22
22
}
23
23
}
24
- stage('Build Docker Images') {
24
+ stage('Build and push Docker Images') {
25
25
steps {
26
- sh '''#!/bin/bash -x
27
- cd ${WORKSPACE}/eclipse.platform.releng.aggregator/cje-production/dockerfiles/
28
- chmod +x *.sh
29
- (./build-centos_9.sh|tee centos9.log)&
30
- (./build-centos_9_swt_build.sh|tee swt_9_build.log)&
31
- (./build-ubuntu-22.04.sh|tee ubuntu22.log)&
32
- (./build-openSuse-15.sh|tee opensuse_leap.log)&
33
- cd ${WORKSPACE}/eclipse.jdt.core/org.eclipse.jdt.core/docker/
34
- chmod +x *.sh
35
- (./build-ubuntu-jikespg.sh|tee ubuntuJikespg.log)&
36
- wait
37
- docker images
38
- '''
39
- }
40
- }
41
- stage('Push docker image') {
42
- steps {
43
- withDockerRegistry([credentialsId: 'docker.com-bot', url: '']) {
44
- sh '''#!/bin/bash -x
45
- cd ${WORKSPACE}/eclipse.platform.releng.aggregator/cje-production/dockerfiles/
46
- chmod +x *.sh
47
- (./push-centos_9.sh|tee push-centos9.log)&
48
- (./push-centos9_swt_build.sh|tee push-swt_9_build.log)&
49
- (./push-ubuntu-22.04.sh|tee push-ubuntu22.log)&
50
- (./push-opensuse-15.sh|tee push-opensuse_leap.log)&
51
- cd ${WORKSPACE}/eclipse.jdt.core/org.eclipse.jdt.core/docker/
52
- chmod +x *.sh
53
- (./push-ubuntu-jikespg.sh|tee push-ubuntuJikespg.log)&
54
- wait
55
- '''
26
+ script {
27
+ dir('eclipse.platform.releng.aggregator/cje-production/dockerfiles') {
28
+ parallel(
29
+ 'centos9-gtk4': { buildAndPushImage('centos-gtk4-mutter/9-gtk4', 'eclipse/platformreleng-centos-gtk4-mutter:9') },
30
+ 'centos9-gtk4-swt': { buildAndPushImage('centos-gtk4-mutter/9-swtBuild', 'eclipse/platformreleng-centos-swt-build:9') },
31
+ 'ubuntu-gtk3': { buildAndPushImage('ubuntu-gtk3-metacity/22.04-gtk3', 'eclipse/platformreleng-ubuntu-gtk3-metacity:22.04') },
32
+ 'opensuse-gtk3': { buildAndPushImage('opensuse-gtk3-metacity/15-gtk3', 'eclipse/platformreleng-opensuse-gtk3-metacity:15') },
33
+ failFast: false)
34
+ }
35
+ dir('eclipse.jdt.core/org.eclipse.jdt.core/docker') {
36
+ parallel(
37
+ 'jikespg': { buildAndPushImage('jikespg', 'eclipse/platformreleng-ubuntu-gtk3-metacity:jikespg') },
38
+ failFast: false)
39
+ }
56
40
}
57
41
}
58
42
}
59
43
stage('Clean Docker Images') {
60
44
steps {
61
- sh '''#!/bin/bash -x
45
+ sh '''
62
46
docker images
63
47
docker system prune -a -f
64
48
docker images
@@ -74,8 +58,18 @@ pipeline {
74
58
75
59
}
76
60
always {
77
- archiveArtifacts '**/*.log'
78
61
cleanWs()
79
62
}
80
63
}
81
64
}
65
+
66
+ def buildAndPushImage(directory, imageId) {
67
+ withDockerRegistry([credentialsId: 'docker.com-bot', url: '']) {
68
+ sh """
69
+ pushd ${directory}
70
+ docker build --pull -t ${imageId} .
71
+ docker push ${imageId}
72
+ popd
73
+ """
74
+ }
75
+ }
0 commit comments