Browse code

ADDED changes to integrate with our new Jenkins ci

Signed-off-by: zelahi <elahi.zuhayr@gmail.com>
(cherry picked from commit 0ecd6ab30f875184073df81aaf2ec570664957da)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

zelahi authored on 2019/07/23 06:19:35
Showing 1 changed files
... ...
@@ -1,39 +1,7 @@
1
-def withGithubStatus(String context, Closure cl) {
2
-  def setGithubStatus = { String state ->
3
-    try {
4
-      def backref = "${BUILD_URL}flowGraphTable/"
5
-      def reposSourceURL = scm.repositories[0].getURIs()[0].toString()
6
-      step(
7
-        $class: 'GitHubCommitStatusSetter',
8
-        contextSource: [$class: "ManuallyEnteredCommitContextSource", context: context],
9
-        errorHandlers: [[$class: 'ShallowAnyErrorHandler']],
10
-        reposSource: [$class: 'ManuallyEnteredRepositorySource', url: reposSourceURL],
11
-        statusBackrefSource: [$class: 'ManuallyEnteredBackrefSource', backref: backref],
12
-        statusResultSource: [$class: 'ConditionalStatusResultSource', results: [[$class: 'AnyBuildResult', state: state]]],
13
-      )
14
-    } catch (err) {
15
-      echo "Exception from GitHubCommitStatusSetter for $context: $err"
16
-    }
17
-  }
18
-
19
-  setGithubStatus 'PENDING'
20
-
21
-  try {
22
-    cl()
23
-	} catch (err) {
24
-    // AbortException signals a "normal" build failure.
25
-    if (!(err instanceof hudson.AbortException)) {
26
-      echo "Exception in withGithubStatus for $context: $err"
27
-		}
28
-		setGithubStatus 'FAILURE'
29
-		throw err
30
-	}
31
-	setGithubStatus 'SUCCESS'
32
-}
33
-
34
-
35 1
 pipeline {
36 2
   agent none
3
+
4
+
37 5
   options {
38 6
     buildDiscarder(logRotator(daysToKeepStr: '30'))
39 7
     timeout(time: 3, unit: 'HOURS')
... ...
@@ -44,8 +12,8 @@ pipeline {
44 44
         booleanParam(name: 'z', defaultValue: true, description: 'IBM Z (s390x) Build/Test')
45 45
         booleanParam(name: 'powerpc', defaultValue: true, description: 'PowerPC (ppc64le) Build/Test')
46 46
         booleanParam(name: 'vendor', defaultValue: true, description: 'Vendor')
47
-        booleanParam(name: 'windowsRS1', defaultValue: true, description: 'Windows 2016 (RS1) Build/Test')
48
-        booleanParam(name: 'windowsRS5', defaultValue: true, description: 'Windows 2019 (RS5) Build/Test')
47
+        booleanParam(name: 'windowsRS1', defaultValue: false, description: 'Windows 2016 (RS1) Build/Test')
48
+        booleanParam(name: 'windowsRS5', defaultValue: false, description: 'Windows 2019 (RS5) Build/Test')
49 49
   }
50 50
   stages {
51 51
     stage('Build') {
... ...
@@ -55,13 +23,10 @@ pipeline {
55 55
             beforeAgent true
56 56
             expression { params.janky }
57 57
           }
58
-          agent {
59
-            node {
60
-              label 'ubuntu-1604-overlay2-stable'
61
-            }
62
-          }
58
+          agent { label 'amd64 && ubuntu-1804 && overlay2' }
59
+          environment { DOCKER_BUILDKIT='1' }
60
+
63 61
           steps {
64
-            withGithubStatus('janky') {
65 62
               sh '''
66 63
                 # todo: include ip_vs in base image
67 64
                 sudo modprobe ip_vs
... ...
@@ -84,7 +49,6 @@ pipeline {
84 84
                 echo "Building e2e image"
85 85
                 docker build --build-arg DOCKER_GITCOMMIT=$GITCOMMIT -t moby-e2e-test -f Dockerfile.e2e .
86 86
               '''
87
-            }
88 87
           }
89 88
           post {
90 89
             always {
... ...
@@ -96,10 +60,11 @@ pipeline {
96 96
                 docker run --rm -v "$WORKSPACE:/workspace" busybox chown -R "$(id -u):$(id -g)" /workspace
97 97
               '''
98 98
               sh '''
99
-                echo "Creating bundles.tar.gz"
100
-                (find bundles -name '*.log' -o -name '*.prof' -o -name integration.test | xargs tar -czf bundles.tar.gz) || true
99
+                echo "Creating janky-bundles.tar.gz"
100
+                (find bundles -name '*.log' -o -name '*.prof' -o -name integration.test | xargs tar -czf janky-bundles.tar.gz) || true
101 101
               '''
102
-              archiveArtifacts artifacts: 'bundles.tar.gz'
102
+              archiveArtifacts artifacts: 'janky-bundles.tar.gz'
103
+              deleteDir()
103 104
             }
104 105
           }
105 106
         }
... ...
@@ -108,13 +73,9 @@ pipeline {
108 108
             beforeAgent true
109 109
             expression { params.experimental }
110 110
           }
111
-          agent {
112
-            node {
113
-              label 'ubuntu-1604-aufs-stable'
114
-            }
115
-          }
111
+          agent { label 'amd64 && ubuntu-1804 && overlay2' }
112
+          environment { DOCKER_BUILDKIT='1' }
116 113
           steps {
117
-            withGithubStatus('experimental') {
118 114
               sh '''
119 115
                 GITCOMMIT=$(git rev-parse --short HEAD)
120 116
                 docker build --rm --force-rm --build-arg APT_MIRROR=cdn-fastly.deb.debian.org -t docker:${GITCOMMIT}-exp .
... ...
@@ -128,7 +89,6 @@ pipeline {
128 128
                     docker:${GITCOMMIT}-exp \
129 129
                     hack/ci/experimental
130 130
               '''
131
-            }
132 131
           }
133 132
           post {
134 133
             always {
... ...
@@ -141,9 +101,13 @@ pipeline {
141 141
               '''
142 142
               sh '''
143 143
                 echo "Creating bundles.tar.gz"
144
-                (find bundles -name '*.log' -o -name '*.prof' -o -name integration.test | xargs tar -czf bundles.tar.gz) || true
144
+                (find bundles -name '*.log' -o -name '*.prof' -o -name integration.test | xargs tar -czf experimental-bundles.tar.gz) || true
145
+              '''
146
+              sh '''
147
+                make clean
145 148
               '''
146
-              archiveArtifacts artifacts: 'bundles.tar.gz'
149
+              archiveArtifacts artifacts: 'experimental-bundles.tar.gz'
150
+              deleteDir()
147 151
             }
148 152
           }
149 153
         }
... ...
@@ -152,13 +116,8 @@ pipeline {
152 152
             beforeAgent true
153 153
             expression { params.z }
154 154
           }
155
-          agent {
156
-            node {
157
-              label 's390x-ubuntu-1604'
158
-            }
159
-          }
155
+          agent { label 's390x-ubuntu-1604' }
160 156
           steps {
161
-            withGithubStatus('z') {
162 157
               sh '''
163 158
                 GITCOMMIT=$(git rev-parse --short HEAD)
164 159
 
... ...
@@ -175,7 +134,6 @@ pipeline {
175 175
                     docker-s390x:$GITCOMMIT \
176 176
                     hack/ci/z
177 177
               '''
178
-            }
179 178
           }
180 179
           post {
181 180
             always {
... ...
@@ -188,9 +146,10 @@ pipeline {
188 188
               '''
189 189
               sh '''
190 190
                 echo "Creating bundles.tar.gz"
191
-                find bundles -name '*.log' | xargs tar -czf bundles.tar.gz
191
+                find bundles -name '*.log' | xargs tar -czf s390x-bundles.tar.gz
192 192
               '''
193
-              archiveArtifacts artifacts: 'bundles.tar.gz'
193
+              archiveArtifacts artifacts: 's390x-bundles.tar.gz'
194
+              deleteDir()
194 195
             }
195 196
           }
196 197
         }
... ...
@@ -199,13 +158,8 @@ pipeline {
199 199
             beforeAgent true
200 200
             expression { params.powerpc }
201 201
           }
202
-          agent {
203
-            node {
204
-              label 'ppc64le-ubuntu-1604'
205
-            }
206
-          }
202
+          agent { label 'ppc64le-ubuntu-1604' }
207 203
           steps {
208
-            withGithubStatus('powerpc') {
209 204
               sh '''
210 205
                 GITCOMMIT=$(git rev-parse --short HEAD)
211 206
 
... ...
@@ -222,7 +176,6 @@ pipeline {
222 222
                     docker-powerpc:$GITCOMMIT \
223 223
                     hack/ci/powerpc
224 224
               '''
225
-            }
226 225
           }
227 226
           post {
228 227
             always {
... ...
@@ -235,9 +188,10 @@ pipeline {
235 235
               '''
236 236
               sh '''
237 237
                 echo "Creating bundles.tar.gz"
238
-                find bundles -name '*.log' | xargs tar -czf bundles.tar.gz
238
+                find bundles -name '*.log' | xargs tar -czf powerpc-bundles.tar.gz
239 239
               '''
240
-              archiveArtifacts artifacts: 'bundles.tar.gz'
240
+              archiveArtifacts artifacts: 'powerpc-bundles.tar.gz'
241
+              deleteDir()
241 242
             }
242 243
           }
243 244
         }
... ...
@@ -246,13 +200,9 @@ pipeline {
246 246
             beforeAgent true
247 247
             expression { params.vendor }
248 248
           }
249
-          agent {
250
-            node {
251
-              label 'ubuntu-1604-aufs-stable'
252
-            }
253
-          }
249
+          agent { label 'amd64 && ubuntu-1804 && overlay2' }
250
+          environment { DOCKER_BUILDKIT='1' }
254 251
           steps {
255
-            withGithubStatus('vendor') {
256 252
               sh '''
257 253
                 GITCOMMIT=$(git rev-parse --short HEAD)
258 254
 
... ...
@@ -266,7 +216,6 @@ pipeline {
266 266
                   -e TIMEOUT=120m dockerven:$GITCOMMIT \
267 267
                   hack/validate/vendor
268 268
               '''
269
-            }
270 269
           }
271 270
         }
272 271
         stage('windowsRS1') {
... ...
@@ -281,13 +230,11 @@ pipeline {
281 281
             }
282 282
           }
283 283
           steps {
284
-            withGithubStatus('windowsRS1') {
285 284
               powershell '''
286 285
                 $ErrorActionPreference = 'Stop'
287 286
                 .\\hack\\ci\\windows.ps1
288 287
                 exit $LastExitCode
289 288
               '''
290
-            }
291 289
           }
292 290
         }
293 291
         stage('windowsRS5-process') {
... ...
@@ -302,13 +249,11 @@ pipeline {
302 302
             }
303 303
           }
304 304
           steps {
305
-            withGithubStatus('windowsRS5-process') {
306 305
               powershell '''
307 306
                 $ErrorActionPreference = 'Stop'
308 307
                 .\\hack\\ci\\windows.ps1
309 308
                 exit $LastExitCode
310 309
               '''
311
-            }
312 310
           }
313 311
         }
314 312
       }