|
| 1 | +pipeline { |
| 2 | + agent { |
| 3 | + label 'linux-x86_64' |
| 4 | + } |
| 5 | + |
| 6 | + triggers { |
| 7 | + cron('0 1 * * *') |
| 8 | + } |
| 9 | + |
| 10 | + options { |
| 11 | + disableConcurrentBuilds() |
| 12 | + buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10')) |
| 13 | + } |
| 14 | + |
| 15 | + environment { |
| 16 | + DOCKER_HUB_USERNAME = credentials('DOCKER_HUB_USERNAME') |
| 17 | + DOCKER_HUB_TOKEN = credentials('DOCKER_HUB_TOKEN') |
| 18 | + } |
| 19 | + |
| 20 | + stages { |
| 21 | + stage('Docker login') { |
| 22 | + steps { |
| 23 | + sh 'docker login -u ${DOCKER_HUB_USERNAME} -p ${DOCKER_HUB_TOKEN}' |
| 24 | + } |
| 25 | + } |
| 26 | + |
| 27 | + stage('Heads') { |
| 28 | + steps { |
| 29 | + script { |
| 30 | + def implementations = "biwascheme chezscheme chibi chicken foment gauche ironscheme kawa lips loko meevax mit-scheme mosh sagittarius skint stak stklos tr7 ypsilon".split() |
| 31 | + parallel implementations.collectEntries { implementation-> |
| 32 | + [(implementation): { |
| 33 | + stage("${implementation} build") { |
| 34 | + timeout(time: 6, unit: 'HOURS') { |
| 35 | + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { |
| 36 | + dir("implementations/${implementation}/head") { |
| 37 | + sh "docker build . --tag=schemers/${implementation}:head" |
| 38 | + } |
| 39 | + } |
| 40 | + } |
| 41 | + } |
| 42 | + stage("${implementation} push") { |
| 43 | + timeout(time: 6, unit: 'HOURS') { |
| 44 | + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { |
| 45 | + dir("implementations/${implementation}/head") { |
| 46 | + sh "docker push schemers/${implementation}:head" |
| 47 | + } |
| 48 | + } |
| 49 | + } |
| 50 | + } |
| 51 | + } |
| 52 | + ] |
| 53 | + } |
| 54 | + } |
| 55 | + } |
| 56 | + } |
| 57 | + |
| 58 | + stage('Docker logout') { |
| 59 | + steps { |
| 60 | + sh "docker logout" |
| 61 | + } |
| 62 | + } |
| 63 | + |
| 64 | + stage('cyclone') { |
| 65 | + steps { |
| 66 | + timeout(time: 6, unit: 'HOURS') { |
| 67 | + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { |
| 68 | + dir("implementations/${STAGE_NAME}/head") { |
| 69 | + sh "docker build . --tag=schemers/${STAGE_NAME}:head" |
| 70 | + } |
| 71 | + sh 'docker login -u ${DOCKER_HUB_USERNAME} -p ${DOCKER_HUB_TOKEN}' |
| 72 | + sh "docker push schemers/${STAGE_NAME}:head" |
| 73 | + sh "docker logout" |
| 74 | + } |
| 75 | + } |
| 76 | + } |
| 77 | + } |
| 78 | + |
| 79 | + stage('gambit') { |
| 80 | + steps { |
| 81 | + timeout(time: 6, unit: 'HOURS') { |
| 82 | + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { |
| 83 | + dir("implementations/${STAGE_NAME}/head") { |
| 84 | + sh "docker build . --tag=schemers/${STAGE_NAME}:head" |
| 85 | + } |
| 86 | + sh 'docker login -u ${DOCKER_HUB_USERNAME} -p ${DOCKER_HUB_TOKEN}' |
| 87 | + sh "docker push schemers/${STAGE_NAME}:head" |
| 88 | + sh "docker logout" |
| 89 | + } |
| 90 | + } |
| 91 | + } |
| 92 | + } |
| 93 | + |
| 94 | + stage('guile') { |
| 95 | + steps { |
| 96 | + timeout(time: 6, unit: 'HOURS') { |
| 97 | + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { |
| 98 | + dir("implementations/${STAGE_NAME}/head") { |
| 99 | + sh "docker build . --tag=schemers/${STAGE_NAME}:head" |
| 100 | + } |
| 101 | + sh 'docker login -u ${DOCKER_HUB_USERNAME} -p ${DOCKER_HUB_TOKEN}' |
| 102 | + sh "docker push schemers/${STAGE_NAME}:head" |
| 103 | + sh "docker logout" |
| 104 | + } |
| 105 | + } |
| 106 | + } |
| 107 | + } |
| 108 | + |
| 109 | + stage('racket') { |
| 110 | + steps { |
| 111 | + timeout(time: 6, unit: 'HOURS') { |
| 112 | + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { |
| 113 | + dir("implementations/${STAGE_NAME}/head") { |
| 114 | + sh "docker build . --tag=schemers/${STAGE_NAME}:head" |
| 115 | + } |
| 116 | + sh 'docker login -u ${DOCKER_HUB_USERNAME} -p ${DOCKER_HUB_TOKEN}' |
| 117 | + sh "docker push schemers/${STAGE_NAME}:head" |
| 118 | + sh "docker logout" |
| 119 | + } |
| 120 | + } |
| 121 | + } |
| 122 | + } |
| 123 | + } |
| 124 | + |
| 125 | + post { |
| 126 | + always { |
| 127 | + sh "docker logout" |
| 128 | + } |
| 129 | + } |
| 130 | +} |
0 commit comments