@@ -22,15 +22,27 @@ pipeline {
2222 DOCKER_GRAPHDRIVER = ' overlay2'
2323 APT_MIRROR = ' cdn-fastly.deb.debian.org'
2424 CHECK_CONFIG_COMMIT = ' 78405559cfe5987174aa2cb6463b9b2c1b917255'
25+ TESTDEBUG = ' 0'
2526 TIMEOUT = ' 120m'
2627 }
2728 stages {
29+ stage(' pr-hack' ) {
30+ when { changeRequest() }
31+ steps {
32+ script {
33+ echo " Workaround for PR auto-cancel feature. Borrowed from https://issues.jenkins-ci.org/browse/JENKINS-43353"
34+ def buildNumber = env. BUILD_NUMBER as int
35+ if (buildNumber > 1 ) milestone(buildNumber - 1 )
36+ milestone(buildNumber)
37+ }
38+ }
39+ }
2840 stage(' DCO-check' ) {
2941 when {
3042 beforeAgent true
3143 expression { ! params. skip_dco }
3244 }
33- agent { label ' linux ' }
45+ agent { label ' amd64 && ubuntu-1804 && overlay2 ' }
3446 steps {
3547 sh '''
3648 docker run --rm \
@@ -257,13 +269,13 @@ pipeline {
257269 run_tests() {
258270 [ -n "$TESTDEBUG" ] && rm= || rm=--rm;
259271 docker run $rm -t --privileged \
260- -v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
272+ -v "$WORKSPACE/bundles/${TEST_INTEGRATION_DEST}:/go/src/github.com/docker/docker/bundles" \
273+ -v "$WORKSPACE/bundles/dynbinary-daemon:/go/src/github.com/docker/docker/bundles/dynbinary-daemon" \
261274 -v "$WORKSPACE/.git:/go/src/github.com/docker/docker/.git" \
262275 --name "$CONTAINER_NAME" \
263276 -e KEEPBUNDLE=1 \
264277 -e TESTDEBUG \
265278 -e TESTFLAGS \
266- -e TEST_INTEGRATION_DEST \
267279 -e TEST_SKIP_INTEGRATION \
268280 -e TEST_SKIP_INTEGRATION_CLI \
269281 -e DOCKER_GITCOMMIT=${GIT_COMMIT} \
@@ -308,14 +320,20 @@ pipeline {
308320 exit $c
309321 '''
310322 }
323+ post {
324+ always {
325+ junit testResults : ' bundles/**/*-report.xml' , allowEmptyResults : true
326+ }
327+ }
311328 }
312329 }
313330
314331 post {
315332 always {
316333 sh '''
317334 echo "Ensuring container killed."
318- docker rm -vf docker-pr$BUILD_NUMBER || true
335+ cids=$(docker ps -aq -f name=docker-pr${BUILD_NUMBER}-*)
336+ [ -n "$cids" ] && docker rm -vf $cids || true
319337 '''
320338
321339 sh '''
@@ -328,7 +346,7 @@ pipeline {
328346 bundleName=amd64
329347 echo "Creating ${bundleName}-bundles.tar.gz"
330348 # exclude overlay2 directories
331- find bundles -path '*/root/*overlay2' -prune -o -type f \\ ( -name '*. log' -o -name '*.prof' \\ ) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
349+ find bundles -path '*/root/*overlay2' -prune -o -type f \\ ( -name '*-report.json' -o -name '*. log' -o -name '*.prof' -o -name '*-report.xml ' \\ ) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
332350 '''
333351
334352 archiveArtifacts artifacts : ' *-bundles.tar.gz' , allowEmptyArchive : true
@@ -397,6 +415,7 @@ pipeline {
397415 -e DOCKER_EXPERIMENTAL \
398416 -e DOCKER_GITCOMMIT=${GIT_COMMIT} \
399417 -e DOCKER_GRAPHDRIVER \
418+ -e TESTDEBUG \
400419 -e TEST_SKIP_INTEGRATION_CLI \
401420 -e TIMEOUT \
402421 docker:${GIT_COMMIT} \
@@ -405,6 +424,11 @@ pipeline {
405424 test-integration
406425 '''
407426 }
427+ post {
428+ always {
429+ junit testResults : ' bundles/**/*-report.xml' , allowEmptyResults : true
430+ }
431+ }
408432 }
409433 }
410434
@@ -425,7 +449,7 @@ pipeline {
425449 bundleName=s390x-integration
426450 echo "Creating ${bundleName}-bundles.tar.gz"
427451 # exclude overlay2 directories
428- find bundles -path '*/root/*overlay2' -prune -o -type f \\ ( -name '*. log' -o -name '*.prof' \\ ) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
452+ find bundles -path '*/root/*overlay2' -prune -o -type f \\ ( -name '*-report.json' -o -name '*. log' -o -name '*.prof' -o -name '*-report.xml ' \\ ) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
429453 '''
430454
431455 archiveArtifacts artifacts : ' *-bundles.tar.gz' , allowEmptyArchive : true
@@ -483,6 +507,11 @@ pipeline {
483507 test-integration
484508 '''
485509 }
510+ post {
511+ always {
512+ junit testResults : ' bundles/**/*-report.xml' , allowEmptyResults : true
513+ }
514+ }
486515 }
487516 }
488517
@@ -503,7 +532,7 @@ pipeline {
503532 bundleName=s390x-integration-cli
504533 echo "Creating ${bundleName}-bundles.tar.gz"
505534 # exclude overlay2 directories
506- find bundles -path '*/root/*overlay2' -prune -o -type f \\ ( -name '*. log' -o -name '*.prof' \\ ) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
535+ find bundles -path '*/root/*overlay2' -prune -o -type f \\ ( -name '*-report.json' -o -name '*. log' -o -name '*.prof' -o -name '*-report.xml ' \\ ) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
507536 '''
508537
509538 archiveArtifacts artifacts : ' *-bundles.tar.gz' , allowEmptyArchive : true
@@ -570,6 +599,7 @@ pipeline {
570599 -e DOCKER_EXPERIMENTAL \
571600 -e DOCKER_GITCOMMIT=${GIT_COMMIT} \
572601 -e DOCKER_GRAPHDRIVER \
602+ -e TESTDEBUG \
573603 -e TEST_SKIP_INTEGRATION_CLI \
574604 -e TIMEOUT \
575605 docker:${GIT_COMMIT} \
@@ -578,6 +608,11 @@ pipeline {
578608 test-integration
579609 '''
580610 }
611+ post {
612+ always {
613+ junit testResults : ' bundles/**/*-report.xml' , allowEmptyResults : true
614+ }
615+ }
581616 }
582617 }
583618
@@ -598,7 +633,7 @@ pipeline {
598633 bundleName=ppc64le-integration
599634 echo "Creating ${bundleName}-bundles.tar.gz"
600635 # exclude overlay2 directories
601- find bundles -path '*/root/*overlay2' -prune -o -type f \\ ( -name '*. log' -o -name '*.prof' \\ ) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
636+ find bundles -path '*/root/*overlay2' -prune -o -type f \\ ( -name '*-report.json' -o -name '*. log' -o -name '*.prof' -o -name '*-report.xml ' \\ ) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
602637 '''
603638
604639 archiveArtifacts artifacts : ' *-bundles.tar.gz' , allowEmptyArchive : true
@@ -654,6 +689,11 @@ pipeline {
654689 test-integration
655690 '''
656691 }
692+ post {
693+ always {
694+ junit testResults : ' bundles/**/*-report.xml' , allowEmptyResults : true
695+ }
696+ }
657697 }
658698 }
659699
@@ -662,8 +702,6 @@ pipeline {
662702 sh '''
663703 echo "Ensuring container killed."
664704 docker rm -vf docker-pr$BUILD_NUMBER || true
665- cids=$(docker ps -aq -f name=docker-pr${BUILD_NUMBER}-*)
666- [ -n "$cids" ] && docker rm -vf $cids || true
667705 '''
668706
669707 sh '''
@@ -676,7 +714,7 @@ pipeline {
676714 bundleName=ppc64le-integration-cli
677715 echo "Creating ${bundleName}-bundles.tar.gz"
678716 # exclude overlay2 directories
679- find bundles -path '*/root/*overlay2' -prune -o -type f \\ ( -name '*. log' -o -name '*.prof' \\ ) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
717+ find bundles -path '*/root/*overlay2' -prune -o -type f \\ ( -name '*-report.json' -o -name '*. log' -o -name '*.prof' -o -name '*-report.xml ' \\ ) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
680718 '''
681719
682720 archiveArtifacts artifacts : ' *-bundles.tar.gz' , allowEmptyArchive : true
@@ -699,11 +737,12 @@ pipeline {
699737 }
700738 environment {
701739 DOCKER_BUILDKIT = ' 0'
740+ DOCKER_DUT_DEBUG = ' 1'
702741 SKIP_VALIDATION_TESTS = ' 1'
703742 SOURCES_DRIVE = ' d'
704743 SOURCES_SUBDIR = ' gopath'
705744 TESTRUN_DRIVE = ' d'
706- TESTRUN_SUBDIR = " CI- $B UILD_NUMBER "
745+ TESTRUN_SUBDIR = " CI"
707746 WINDOWS_BASE_IMAGE = ' mcr.microsoft.com/windows/servercore'
708747 WINDOWS_BASE_IMAGE_TAG = ' ltsc2016'
709748 }
@@ -732,6 +771,25 @@ pipeline {
732771 }
733772 }
734773 }
774+ post {
775+ always {
776+ catchError(buildResult : ' SUCCESS' , stageResult : ' FAILURE' , message : ' Failed to create bundles.tar.gz' ) {
777+ powershell '''
778+ $bundleName="windowsRS1-integration"
779+ Write-Host -ForegroundColor Green "Creating ${bundleName}-bundles.zip"
780+
781+ # archiveArtifacts does not support env-vars to , so save the artifacts in a fixed location
782+ Compress-Archive -Path "${env:TEMP}/CIDUT.out", "${env:TEMP}/CIDUT.err" -CompressionLevel Optimal -DestinationPath "${bundleName}-bundles.zip"
783+ '''
784+
785+ archiveArtifacts artifacts : ' *-bundles.zip' , allowEmptyArchive : true
786+ }
787+ }
788+ cleanup {
789+ sh ' make clean'
790+ deleteDir()
791+ }
792+ }
735793 }
736794 stage(' win-RS5' ) {
737795 when {
@@ -740,11 +798,12 @@ pipeline {
740798 }
741799 environment {
742800 DOCKER_BUILDKIT = ' 0'
801+ DOCKER_DUT_DEBUG = ' 1'
743802 SKIP_VALIDATION_TESTS = ' 1'
744803 SOURCES_DRIVE = ' d'
745804 SOURCES_SUBDIR = ' gopath'
746805 TESTRUN_DRIVE = ' d'
747- TESTRUN_SUBDIR = " CI- $B UILD_NUMBER "
806+ TESTRUN_SUBDIR = " CI"
748807 WINDOWS_BASE_IMAGE = ' mcr.microsoft.com/windows/servercore'
749808 WINDOWS_BASE_IMAGE_TAG = ' ltsc2019'
750809 }
@@ -772,6 +831,25 @@ pipeline {
772831 }
773832 }
774833 }
834+ post {
835+ always {
836+ catchError(buildResult : ' SUCCESS' , stageResult : ' FAILURE' , message : ' Failed to create bundles.tar.gz' ) {
837+ powershell '''
838+ $bundleName="windowsRS5-integration"
839+ Write-Host -ForegroundColor Green "Creating ${bundleName}-bundles.zip"
840+
841+ # archiveArtifacts does not support env-vars to , so save the artifacts in a fixed location
842+ Compress-Archive -Path "${env:TEMP}/CIDUT.out", "${env:TEMP}/CIDUT.err" -CompressionLevel Optimal -DestinationPath "${bundleName}-bundles.zip"
843+ '''
844+
845+ archiveArtifacts artifacts : ' *-bundles.zip' , allowEmptyArchive : true
846+ }
847+ }
848+ cleanup {
849+ sh ' make clean'
850+ deleteDir()
851+ }
852+ }
775853 }
776854 }
777855 }
0 commit comments