|
| 1 | +pipeline { |
| 2 | + options { |
| 3 | + timeout(time: 2, unit: 'HOURS') |
| 4 | + buildDiscarder(logRotator(numToKeepStr:'5')) |
| 5 | + disableConcurrentBuilds(abortPrevious: true) |
| 6 | + timestamps() |
| 7 | + } |
| 8 | + agent { |
| 9 | + label 'docker-build' |
| 10 | + } |
| 11 | + stages { |
| 12 | + stage('Clean workspace') { |
| 13 | + steps { |
| 14 | + sh '''#!/bin/bash -x |
| 15 | + docker images |
| 16 | + docker system prune -a -f |
| 17 | + cd ${WORKSPACE} |
| 18 | + rm -rf * |
| 19 | + ''' |
| 20 | + } |
| 21 | + } |
| 22 | + stage('Get Docker Files') { |
| 23 | + steps { |
| 24 | + sh ''' |
| 25 | + git clone -b master https://github.com/eclipse-platform/eclipse.platform.releng.aggregator.git |
| 26 | + git clone -b master https://git.eclipse.org/r/jdt/eclipse.jdt.core.git |
| 27 | + ''' |
| 28 | + } |
| 29 | + } |
| 30 | + stage('Build Docker Images') { |
| 31 | + steps { |
| 32 | + sh '''#!/bin/bash -x |
| 33 | + cd ${WORKSPACE}/eclipse.platform.releng.aggregator/cje-production/dockerfiles/ |
| 34 | + chmod +x *.sh |
| 35 | + (./build-centos_8.sh|tee centos8.log)& |
| 36 | + (./build-centos_swt_build.sh|tee swt_build.log)& |
| 37 | + (./build-centos_9.sh|tee centos9.log)& |
| 38 | + (./build-centos_9_swt_build.sh|tee swt_9_build.log)& |
| 39 | + (./build-ubuntu-22.04.sh|tee ubuntu22.log)& |
| 40 | + (./build-openSuse-15.sh|tee opensuse_leap.log)& |
| 41 | + cd ${WORKSPACE}/eclipse.jdt.core/org.eclipse.jdt.core/docker/ |
| 42 | + chmod +x *.sh |
| 43 | + (./build-ubuntu-jikespg.sh|tee ubuntuJikespg.log)& |
| 44 | + wait |
| 45 | + docker images |
| 46 | + ''' |
| 47 | + } |
| 48 | + } |
| 49 | + stage('Push docker image') { |
| 50 | + steps { |
| 51 | + withDockerRegistry([credentialsId: 'docker.com-bot', url: '']) { |
| 52 | + sh '''#!/bin/bash -x |
| 53 | + cd ${WORKSPACE}/eclipse.platform.releng.aggregator/cje-production/dockerfiles/ |
| 54 | + chmod +x *.sh |
| 55 | + (./push-centos_8.sh|tee push-centos8.log)& |
| 56 | + (./push-centos_swt_build.sh|tee push-swt_build.log)& |
| 57 | + (./push-centos_9.sh|tee push-centos9.log)& |
| 58 | + (./push-centos9_swt_build.sh|tee push-swt_9_build.log)& |
| 59 | + (./push-ubuntu-22.04.sh|tee push-ubuntu22.log)& |
| 60 | + (./push-opensuse-15.sh|tee push-opensuse_leap.log)& |
| 61 | + cd ${WORKSPACE}/eclipse.jdt.core/org.eclipse.jdt.core/docker/ |
| 62 | + chmod +x *.sh |
| 63 | + (./push-ubuntu-jikespg.sh|tee push-ubuntuJikespg.log)& |
| 64 | + wait |
| 65 | + ''' |
| 66 | + } |
| 67 | + } |
| 68 | + } |
| 69 | + stage('Clean Docker Images') { |
| 70 | + steps { |
| 71 | + sh '''#!/bin/bash -x |
| 72 | + docker images |
| 73 | + docker system prune -a -f |
| 74 | + docker images |
| 75 | + ''' |
| 76 | + } |
| 77 | + } |
| 78 | + } |
| 79 | + post { |
| 80 | + success { |
| 81 | + emailext body: "Container images used for testing eclipse platform - Build Successful. Please go to ${BUILD_URL}console and check the log", |
| 82 | + subject: "Container images - Build Successful", |
| 83 | + |
| 84 | + |
| 85 | + } |
| 86 | + |
| 87 | + unsuccessful { |
| 88 | + emailext body: "Container images used for testing eclipse platform - Build Unsuccessful. Please go to ${BUILD_URL}console and check the log", |
| 89 | + subject: "Container images - Build Unsuccessful", |
| 90 | + |
| 91 | + |
| 92 | + } |
| 93 | + |
| 94 | + always { |
| 95 | + archiveArtifacts '**/*.log' |
| 96 | + } |
| 97 | + } |
| 98 | +} |
0 commit comments