forked from docker-library/golang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.jenkins
60 lines (50 loc) · 1.23 KB
/
.jenkins
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
def versions = ["1.13", "1.14", "1.15", "1.16"]
def generateBuildStage(job) {
return {
stage("Build golang:${job}") {
sh "docker build -t vaporio/golang:${job} ${job}/bionic"
}
}
}
def generatePublishStage(job) {
return {
stage("Publish golang:${job}") {
withDockerRegistry(registry: [credentialsId: 'vio-docker-hub']) {
sh "docker push vaporio/golang:${job}"
}
}
}
}
def buildStagesMap = versions.collectEntries {
["${it}" : generateBuildStage(it)]
}
def publishStagesMap = versions.collectEntries {
["${it}" : generatePublishStage(it)]
}
pipeline {
agent any
triggers {
upstream(upstreamProjects: 'vapor-ware/buildpack-deps/master', threshold: hudson.model.Result.SUCCESS)
}
stages {
stage('Update') {
steps {
sh './update.sh'
}
}
stage('Build') {
steps {
script {
parallel buildStagesMap
}
}
}
stage('Publish') {
steps {
script {
parallel publishStagesMap
}
}
}
}
}