forked from galasa-dev-archives/build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.manifests
155 lines (145 loc) · 8.11 KB
/
Jenkinsfile.manifests
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
def mvnProfile = 'unknown'
def dockerVersion = 'unknown'
def gitBranch = 'unknown'
pipeline {
// Initially run on any agent
agent any
environment {
//Configure Maven from the maven tooling in Jenkins
def mvnHome = tool 'Default'
PATH = "${mvnHome}/bin:${env.PATH}"
//Set some defaults
def workspace = pwd()
def mvnGoal = 'deploy'
def dockerRepository = 'cicsts-docker-local.artifactory.swg-devops.com'
}
stages {
// Build all the platform indenpendent manifests, including latest versions if required
// Built in parallel because the awful manifest push is so very very slow
stage('docker-manifests') {
parallel {
stage('manifest-boot-embedded') {
agent {
label 'docker-amd64'
}
steps {
sh "rm -rf ~/.docker/manifests/${dockerRepository}_galasa-boot-embedded-${dockerVersion}"
sh "docker pull ${dockerRepository}/galasa-boot-embedded-amd64:${dockerVersion}"
sh "docker pull ${dockerRepository}/galasa-boot-embedded-s390x:${dockerVersion}"
sh "docker manifest create ${dockerRepository}/galasa-boot-embedded:${dockerVersion} ${dockerRepository}/galasa-boot-embedded-amd64:${dockerVersion} ${dockerRepository}/galasa-boot-embedded-s390x:${dockerVersion}"
sh "docker manifest push ${dockerRepository}/galasa-boot-embedded:${dockerVersion}"
}
}
stage('manifest-boot-embedded-latest') {
when {
environment name: 'GIT_BRANCH', value: 'origin/master'
}
agent {
label 'docker-amd64'
}
steps {
sh "rm -rf ~/.docker/manifests/${dockerRepository}_galasa-boot-embedded-latest"
sh "docker pull ${dockerRepository}/galasa-boot-embedded-amd64:${dockerVersion}"
sh "docker pull ${dockerRepository}/galasa-boot-embedded-s390x:${dockerVersion}"
sh "docker manifest create ${dockerRepository}/galasa-boot-embedded:latest ${dockerRepository}/galasa-boot-embedded-amd64:${dockerVersion} ${dockerRepository}/galasa-boot-embedded-s390x:${dockerVersion}"
sh "docker manifest push ${dockerRepository}/galasa-boot-embedded:latest"
}
}
stage('manifest-ras-couchdb-init') {
agent {
label 'docker-amd64'
}
steps {
sh "rm -rf ~/.docker/manifests/${dockerRepository}_galasa-ras-couchdb-init-${dockerVersion}"
sh "docker pull ${dockerRepository}/galasa-ras-couchdb-init-amd64:${dockerVersion}"
sh "docker pull ${dockerRepository}/galasa-ras-couchdb-init-s390x:${dockerVersion}"
sh "docker manifest create ${dockerRepository}/galasa-ras-couchdb-init:${dockerVersion} ${dockerRepository}/galasa-ras-couchdb-init-amd64:${dockerVersion} ${dockerRepository}/galasa-ras-couchdb-init-s390x:${dockerVersion}"
sh "docker manifest push ${dockerRepository}/galasa-ras-couchdb-init:${dockerVersion}"
}
}
stage('manifest-ras-couchdb-init-latest') {
when {
environment name: 'GIT_BRANCH', value: 'origin/master'
}
agent {
label 'docker-amd64'
}
steps {
sh "rm -rf ~/.docker/manifests/${dockerRepository}_galasa-ras-couchdb-init-latest"
sh "docker pull ${dockerRepository}/galasa-ras-couchdb-init-amd64:${dockerVersion}"
sh "docker pull ${dockerRepository}/galasa-ras-couchdb-init-s390x:${dockerVersion}"
sh "docker manifest create ${dockerRepository}/galasa-ras-couchdb-init:latest ${dockerRepository}/galasa-ras-couchdb-init-amd64:${dockerVersion} ${dockerRepository}/galasa-ras-couchdb-init-s390x:${dockerVersion}"
sh "docker manifest push ${dockerRepository}/galasa-ras-couchdb-init:latest"
}
}
stage('manifest-resources') {
agent {
label 'docker-amd64'
}
steps {
sh "rm -rf ~/.docker/manifests/${dockerRepository}_galasa-resources-${dockerVersion}"
sh "docker pull ${dockerRepository}/galasa-resources-amd64:${dockerVersion}"
sh "docker pull ${dockerRepository}/galasa-resources-s390x:${dockerVersion}"
sh "docker manifest create ${dockerRepository}/galasa-resources:${dockerVersion} ${dockerRepository}/galasa-resources-amd64:${dockerVersion} ${dockerRepository}/galasa-resources-s390x:${dockerVersion}"
sh "docker manifest push ${dockerRepository}/galasa-resources:${dockerVersion}"
}
}
stage('manifest-resources-latest') {
when {
environment name: 'GIT_BRANCH', value: 'origin/master'
}
agent {
label 'docker-amd64'
}
steps {
sh "rm -rf ~/.docker/manifests/${dockerRepository}_galasa-resources-latest"
sh "docker pull ${dockerRepository}/galasa-resources-amd64:${dockerVersion}"
sh "docker pull ${dockerRepository}/galasa-resources-s390x:${dockerVersion}"
sh "docker manifest create ${dockerRepository}/galasa-resources:latest ${dockerRepository}/galasa-resources-amd64:${dockerVersion} ${dockerRepository}/galasa-resources-s390x:${dockerVersion}"
sh "docker manifest push ${dockerRepository}/galasa-resources:latest"
}
}
stage('manifest-ibm-boot') {
agent {
label 'docker-amd64'
}
steps {
sh "rm -rf ~/.docker/manifests/${dockerRepository}_galasa-ibm-boot-embedded-${dockerVersion}"
sh "docker pull ${dockerRepository}/galasa-ibm-boot-embedded-amd64:${dockerVersion}"
sh "docker pull ${dockerRepository}/galasa-ibm-boot-embedded-s390x:${dockerVersion}"
sh "docker manifest create ${dockerRepository}/galasa-ibm-boot-embedded:${dockerVersion} ${dockerRepository}/galasa-ibm-boot-embedded-amd64:${dockerVersion} ${dockerRepository}/galasa-ibm-boot-embedded-s390x:${dockerVersion}"
sh "docker manifest push ${dockerRepository}/galasa-ibm-boot-embedded:${dockerVersion}"
}
}
stage('manifest-ibm-boot-latest') {
when {
environment name: 'GIT_BRANCH', value: 'origin/master'
}
agent {
label 'docker-amd64'
}
steps {
sh "rm -rf ~/.docker/manifests/${dockerRepository}_galasa-ibm-boot-embedded-latest"
sh "docker pull ${dockerRepository}/galasa-ibm-boot-embedded-amd64:${dockerVersion}"
sh "docker pull ${dockerRepository}/galasa-ibm-boot-embedded-s390x:${dockerVersion}"
sh "docker manifest create ${dockerRepository}/galasa-ibm-boot-embedded:latest ${dockerRepository}/galasa-ibm-boot-embedded-amd64:${dockerVersion} ${dockerRepository}/galasa-ibm-boot-embedded-s390x:${dockerVersion}"
sh "docker manifest push ${dockerRepository}/galasa-ibm-boot-embedded:latest"
}
}
stage('manifest-api-bootstrap-latest') {
when {
environment name: 'GIT_BRANCH', value: 'origin/master'
}
agent {
label 'docker-amd64'
}
steps {
sh "docker pull ${dockerRepository}/galasa-api-bootstrap-amd64:${dockerVersion}"
sh "docker tag ${dockerRepository}/galasa-api-bootstrap-amd64:${dockerVersion} ${dockerRepository}/galasa-api-bootstrap-amd64:latest"
sh "docker push ${dockerRepository}/galasa-api-bootstrap-amd64:latest"
}
}
}
}
}
}