@@ -7,17 +7,64 @@ pipeline {
77 timeout(time : 3 , unit : ' HOURS' )
88 }
99 parameters {
10- booleanParam(name : ' janky' , defaultValue : true , description : ' x86 Build/Test' )
11- booleanParam(name : ' experimental' , defaultValue : true , description : ' x86 Experimental Build/Test ' )
12- booleanParam(name : ' z' , defaultValue : true , description : ' IBM Z (s390x) Build/Test' )
13- booleanParam(name : ' powerpc' , defaultValue : true , description : ' PowerPC (ppc64le) Build/Test' )
14- booleanParam(name : ' vendor' , defaultValue : true , description : ' Vendor' )
10+ booleanParam(name : ' unit' , defaultValue : true , description : ' x86 unit tests' )
11+ booleanParam(name : ' janky' , defaultValue : false , description : ' x86 Build/Test' )
12+ booleanParam(name : ' experimental' , defaultValue : false , description : ' x86 Experimental Build/Test ' )
13+ booleanParam(name : ' z' , defaultValue : false , description : ' IBM Z (s390x) Build/Test' )
14+ booleanParam(name : ' powerpc' , defaultValue : false , description : ' PowerPC (ppc64le) Build/Test' )
15+ booleanParam(name : ' vendor' , defaultValue : false , description : ' Vendor' )
1516 booleanParam(name : ' windowsRS1' , defaultValue : false , description : ' Windows 2016 (RS1) Build/Test' )
1617 booleanParam(name : ' windowsRS5' , defaultValue : false , description : ' Windows 2019 (RS5) Build/Test' )
1718 }
1819 stages {
1920 stage(' Build' ) {
2021 parallel {
22+ stage(' unit' ) {
23+ when {
24+ beforeAgent true
25+ expression { params. unit }
26+ }
27+ agent { label ' amd64 && ubuntu-1804 && overlay2' }
28+ environment { DOCKER_BUILDKIT = ' 1' }
29+
30+ steps {
31+ sh '''
32+ # todo: include ip_vs in base image
33+ sudo modprobe ip_vs
34+
35+ GITCOMMIT=$(git rev-parse --short HEAD)
36+ docker build --rm --force-rm --build-arg APT_MIRROR=cdn-fastly.deb.debian.org -t docker:$GITCOMMIT .
37+
38+ docker run --rm -t --privileged \
39+ -v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
40+ -v "$WORKSPACE/.git:/go/src/github.com/docker/docker/.git" \
41+ --name docker-pr$BUILD_NUMBER \
42+ -e DOCKER_GITCOMMIT=${GITCOMMIT} \
43+ -e DOCKER_GRAPHDRIVER=overlay2 \
44+ -e GIT_SHA1=${GIT_COMMIT} \
45+ docker:$GITCOMMIT \
46+ hack/test/unit-junit
47+ '''
48+ }
49+ post {
50+ always {
51+ sh '''
52+ echo "Ensuring container killed."
53+ docker rm -vf docker-pr$BUILD_NUMBER || true
54+
55+ echo "Chowning /workspace to jenkins user"
56+ docker run --rm -v "$WORKSPACE:/workspace" busybox chown -R "$(id -u):$(id -g)" /workspace
57+ '''
58+ sh '''
59+ echo "Creating unit-bundles.tar.gz"
60+ (find bundles -name '*.log' -o -name '*.prof' -o -name integration.test | xargs tar -czf unit-bundles.tar.gz) || true
61+ '''
62+ archiveArtifacts artifacts : ' unit-bundles.tar.gz'
63+ junit ' junit-report.xml'
64+ deleteDir()
65+ }
66+ }
67+ }
2168 stage(' janky' ) {
2269 when {
2370 beforeAgent true
0 commit comments