Jenkinsfile 67 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324
  1. #!groovy
  2. pipeline {
  3. agent none
  4. options {
  5. buildDiscarder(logRotator(daysToKeepStr: '30'))
  6. timeout(time: 2, unit: 'HOURS')
  7. timestamps()
  8. }
  9. parameters {
  10. booleanParam(name: 'unit_validate', defaultValue: true, description: 'amd64 (x86_64) unit tests and vendor check')
  11. booleanParam(name: 'validate_force', defaultValue: false, description: 'force validation steps to be run, even if no changes were detected')
  12. booleanParam(name: 'amd64', defaultValue: true, description: 'amd64 (x86_64) Build/Test')
  13. booleanParam(name: 'rootless', defaultValue: true, description: 'amd64 (x86_64) Build/Test (Rootless mode)')
  14. booleanParam(name: 'cgroup2', defaultValue: true, description: 'amd64 (x86_64) Build/Test (cgroup v2)')
  15. booleanParam(name: 'arm64', defaultValue: true, description: 'ARM (arm64) Build/Test')
  16. booleanParam(name: 's390x', defaultValue: false, description: 'IBM Z (s390x) Build/Test')
  17. booleanParam(name: 'ppc64le', defaultValue: false, description: 'PowerPC (ppc64le) Build/Test')
  18. booleanParam(name: 'windowsRS1', defaultValue: false, description: 'Windows 2016 (RS1) Build/Test')
  19. booleanParam(name: 'windowsRS5', defaultValue: true, description: 'Windows 2019 (RS5) Build/Test')
  20. booleanParam(name: 'windows2022', defaultValue: true, description: 'Windows 2022 (LTSC) Build/Test')
  21. booleanParam(name: 'windows2022containerd', defaultValue: true, description: 'Windows 2022 (LTSC) with containerd Build/Test')
  22. booleanParam(name: 'dco', defaultValue: true, description: 'Run the DCO check')
  23. }
  24. environment {
  25. DOCKER_BUILDKIT = '1'
  26. DOCKER_EXPERIMENTAL = '1'
  27. DOCKER_GRAPHDRIVER = 'overlay2'
  28. APT_MIRROR = 'cdn-fastly.deb.debian.org'
  29. CHECK_CONFIG_COMMIT = '33a3680e08d1007e72c3b3f1454f823d8e9948ee'
  30. TESTDEBUG = '0'
  31. TIMEOUT = '120m'
  32. }
  33. stages {
  34. stage('pr-hack') {
  35. when { changeRequest() }
  36. steps {
  37. script {
  38. echo "Workaround for PR auto-cancel feature. Borrowed from https://issues.jenkins-ci.org/browse/JENKINS-43353"
  39. def buildNumber = env.BUILD_NUMBER as int
  40. if (buildNumber > 1) milestone(buildNumber - 1)
  41. milestone(buildNumber)
  42. }
  43. }
  44. }
  45. stage('DCO-check') {
  46. when {
  47. beforeAgent true
  48. expression { params.dco }
  49. }
  50. agent { label 'amd64 && ubuntu-1804 && overlay2' }
  51. steps {
  52. sh '''
  53. docker run --rm \
  54. -v "$WORKSPACE:/workspace" \
  55. -e VALIDATE_REPO=${GIT_URL} \
  56. -e VALIDATE_BRANCH=${CHANGE_TARGET} \
  57. alpine sh -c 'apk add --no-cache -q bash git openssh-client && cd /workspace && hack/validate/dco'
  58. '''
  59. }
  60. }
  61. stage('Build') {
  62. parallel {
  63. stage('unit-validate') {
  64. when {
  65. beforeAgent true
  66. expression { params.unit_validate }
  67. }
  68. agent { label 'amd64 && ubuntu-1804 && overlay2' }
  69. environment {
  70. // On master ("non-pull-request"), force running some validation checks (vendor, swagger),
  71. // even if no files were changed. This allows catching problems caused by pull-requests
  72. // that were merged out-of-sequence.
  73. TEST_FORCE_VALIDATE = sh returnStdout: true, script: 'if [ "${BRANCH_NAME%%-*}" != "PR" ] || [ "${CHANGE_TARGET:-master}" != "master" ] || [ "${validate_force}" = "true" ]; then echo "1"; fi'
  74. }
  75. stages {
  76. stage("Print info") {
  77. steps {
  78. sh 'docker version'
  79. sh 'docker info'
  80. sh '''
  81. echo "check-config.sh version: ${CHECK_CONFIG_COMMIT}"
  82. curl -fsSL -o ${WORKSPACE}/check-config.sh "https://raw.githubusercontent.com/moby/moby/${CHECK_CONFIG_COMMIT}/contrib/check-config.sh" \
  83. && bash ${WORKSPACE}/check-config.sh || true
  84. '''
  85. }
  86. }
  87. stage("Build dev image") {
  88. steps {
  89. sh 'docker build --force-rm --build-arg APT_MIRROR --build-arg CROSS=true -t docker:${GIT_COMMIT} .'
  90. }
  91. }
  92. stage("Validate") {
  93. steps {
  94. sh '''
  95. docker run --rm -t --privileged \
  96. -v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
  97. -v "$WORKSPACE/.git:/go/src/github.com/docker/docker/.git" \
  98. --name docker-pr$BUILD_NUMBER \
  99. -e DOCKER_EXPERIMENTAL \
  100. -e DOCKER_GITCOMMIT=${GIT_COMMIT} \
  101. -e DOCKER_GRAPHDRIVER \
  102. -e TEST_FORCE_VALIDATE \
  103. -e VALIDATE_REPO=${GIT_URL} \
  104. -e VALIDATE_BRANCH=${CHANGE_TARGET} \
  105. docker:${GIT_COMMIT} \
  106. hack/validate/default
  107. '''
  108. }
  109. }
  110. stage("Docker-py") {
  111. steps {
  112. sh '''
  113. docker run --rm -t --privileged \
  114. -v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
  115. --name docker-pr$BUILD_NUMBER \
  116. -e DOCKER_EXPERIMENTAL \
  117. -e DOCKER_GITCOMMIT=${GIT_COMMIT} \
  118. -e DOCKER_GRAPHDRIVER \
  119. -e VALIDATE_REPO=${GIT_URL} \
  120. -e VALIDATE_BRANCH=${CHANGE_TARGET} \
  121. docker:${GIT_COMMIT} \
  122. hack/make.sh \
  123. dynbinary \
  124. test-docker-py
  125. '''
  126. }
  127. post {
  128. always {
  129. junit testResults: 'bundles/test-docker-py/junit-report.xml', allowEmptyResults: true
  130. sh '''
  131. echo "Ensuring container killed."
  132. docker rm -vf docker-pr$BUILD_NUMBER || true
  133. '''
  134. sh '''
  135. echo 'Chowning /workspace to jenkins user'
  136. docker run --rm -v "$WORKSPACE:/workspace" busybox chown -R "$(id -u):$(id -g)" /workspace
  137. '''
  138. catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') {
  139. sh '''
  140. bundleName=docker-py
  141. echo "Creating ${bundleName}-bundles.tar.gz"
  142. tar -czf ${bundleName}-bundles.tar.gz bundles/test-docker-py/*.xml bundles/test-docker-py/*.log
  143. '''
  144. archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
  145. }
  146. }
  147. }
  148. }
  149. stage("Static") {
  150. steps {
  151. sh '''
  152. docker run --rm -t --privileged \
  153. -v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
  154. --name docker-pr$BUILD_NUMBER \
  155. -e DOCKER_GITCOMMIT=${GIT_COMMIT} \
  156. -e DOCKER_GRAPHDRIVER \
  157. docker:${GIT_COMMIT} \
  158. hack/make.sh binary
  159. '''
  160. }
  161. }
  162. stage("Cross") {
  163. steps {
  164. sh '''
  165. docker run --rm -t --privileged \
  166. -v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
  167. --name docker-pr$BUILD_NUMBER \
  168. -e DOCKER_GITCOMMIT=${GIT_COMMIT} \
  169. -e DOCKER_GRAPHDRIVER \
  170. docker:${GIT_COMMIT} \
  171. hack/make.sh cross
  172. '''
  173. }
  174. }
  175. // needs to be last stage that calls make.sh for the junit report to work
  176. stage("Unit tests") {
  177. steps {
  178. sh '''
  179. sudo modprobe ip6table_filter
  180. '''
  181. sh '''
  182. docker run --rm -t --privileged \
  183. -v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
  184. --name docker-pr$BUILD_NUMBER \
  185. -e DOCKER_EXPERIMENTAL \
  186. -e DOCKER_GITCOMMIT=${GIT_COMMIT} \
  187. -e DOCKER_GRAPHDRIVER \
  188. -e VALIDATE_REPO=${GIT_URL} \
  189. -e VALIDATE_BRANCH=${CHANGE_TARGET} \
  190. docker:${GIT_COMMIT} \
  191. hack/test/unit
  192. '''
  193. }
  194. post {
  195. always {
  196. junit testResults: 'bundles/junit-report*.xml', allowEmptyResults: true
  197. }
  198. }
  199. }
  200. stage("Validate vendor") {
  201. steps {
  202. sh '''
  203. docker run --rm -t --privileged \
  204. -v "$WORKSPACE/.git:/go/src/github.com/docker/docker/.git" \
  205. --name docker-pr$BUILD_NUMBER \
  206. -e DOCKER_EXPERIMENTAL \
  207. -e DOCKER_GITCOMMIT=${GIT_COMMIT} \
  208. -e DOCKER_GRAPHDRIVER \
  209. -e TEST_FORCE_VALIDATE \
  210. -e VALIDATE_REPO=${GIT_URL} \
  211. -e VALIDATE_BRANCH=${CHANGE_TARGET} \
  212. docker:${GIT_COMMIT} \
  213. hack/validate/vendor
  214. '''
  215. }
  216. }
  217. }
  218. post {
  219. always {
  220. sh '''
  221. echo 'Ensuring container killed.'
  222. docker rm -vf docker-pr$BUILD_NUMBER || true
  223. '''
  224. sh '''
  225. echo 'Chowning /workspace to jenkins user'
  226. docker run --rm -v "$WORKSPACE:/workspace" busybox chown -R "$(id -u):$(id -g)" /workspace
  227. '''
  228. catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') {
  229. sh '''
  230. bundleName=unit
  231. echo "Creating ${bundleName}-bundles.tar.gz"
  232. tar -czvf ${bundleName}-bundles.tar.gz bundles/junit-report*.xml bundles/go-test-report*.json bundles/profile*.out
  233. '''
  234. archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
  235. }
  236. }
  237. cleanup {
  238. sh 'make clean'
  239. deleteDir()
  240. }
  241. }
  242. }
  243. stage('amd64') {
  244. when {
  245. beforeAgent true
  246. expression { params.amd64 }
  247. }
  248. agent { label 'amd64 && ubuntu-1804 && overlay2' }
  249. stages {
  250. stage("Print info") {
  251. steps {
  252. sh 'docker version'
  253. sh 'docker info'
  254. sh '''
  255. echo "check-config.sh version: ${CHECK_CONFIG_COMMIT}"
  256. curl -fsSL -o ${WORKSPACE}/check-config.sh "https://raw.githubusercontent.com/moby/moby/${CHECK_CONFIG_COMMIT}/contrib/check-config.sh" \
  257. && bash ${WORKSPACE}/check-config.sh || true
  258. '''
  259. }
  260. }
  261. stage("Build dev image") {
  262. steps {
  263. sh '''
  264. # todo: include ip_vs in base image
  265. sudo modprobe ip_vs
  266. docker build --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} .
  267. '''
  268. }
  269. }
  270. stage("Run tests") {
  271. steps {
  272. sh '''#!/bin/bash
  273. # bash is needed so 'jobs -p' works properly
  274. # it also accepts setting inline envvars for functions without explicitly exporting
  275. set -x
  276. run_tests() {
  277. [ -n "$TESTDEBUG" ] && rm= || rm=--rm;
  278. docker run $rm -t --privileged \
  279. -v "$WORKSPACE/bundles/${TEST_INTEGRATION_DEST}:/go/src/github.com/docker/docker/bundles" \
  280. -v "$WORKSPACE/bundles/dynbinary-daemon:/go/src/github.com/docker/docker/bundles/dynbinary-daemon" \
  281. -v "$WORKSPACE/.git:/go/src/github.com/docker/docker/.git" \
  282. --name "$CONTAINER_NAME" \
  283. -e KEEPBUNDLE=1 \
  284. -e TESTDEBUG \
  285. -e TESTFLAGS \
  286. -e TEST_SKIP_INTEGRATION \
  287. -e TEST_SKIP_INTEGRATION_CLI \
  288. -e DOCKER_GITCOMMIT=${GIT_COMMIT} \
  289. -e DOCKER_GRAPHDRIVER \
  290. -e TIMEOUT \
  291. -e VALIDATE_REPO=${GIT_URL} \
  292. -e VALIDATE_BRANCH=${CHANGE_TARGET} \
  293. docker:${GIT_COMMIT} \
  294. hack/make.sh \
  295. "$1" \
  296. test-integration
  297. }
  298. trap "exit" INT TERM
  299. trap 'pids=$(jobs -p); echo "Remaining pids to kill: [$pids]"; [ -z "$pids" ] || kill $pids' EXIT
  300. CONTAINER_NAME=docker-pr$BUILD_NUMBER
  301. docker run --rm -t --privileged \
  302. -v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
  303. -v "$WORKSPACE/.git:/go/src/github.com/docker/docker/.git" \
  304. --name ${CONTAINER_NAME}-build \
  305. -e DOCKER_EXPERIMENTAL \
  306. -e DOCKER_GITCOMMIT=${GIT_COMMIT} \
  307. -e DOCKER_GRAPHDRIVER \
  308. docker:${GIT_COMMIT} \
  309. hack/make.sh \
  310. dynbinary
  311. # flaky + integration
  312. TEST_INTEGRATION_DEST=1 CONTAINER_NAME=${CONTAINER_NAME}-1 TEST_SKIP_INTEGRATION_CLI=1 run_tests test-integration-flaky &
  313. # integration-cli first set
  314. TEST_INTEGRATION_DEST=2 CONTAINER_NAME=${CONTAINER_NAME}-2 TEST_SKIP_INTEGRATION=1 TESTFLAGS="-test.run Test(DockerSuite|DockerNetworkSuite|DockerHubPullSuite|DockerRegistrySuite|DockerSchema1RegistrySuite|DockerRegistryAuthTokenSuite|DockerRegistryAuthHtpasswdSuite)/" run_tests &
  315. # integration-cli second set
  316. TEST_INTEGRATION_DEST=3 CONTAINER_NAME=${CONTAINER_NAME}-3 TEST_SKIP_INTEGRATION=1 TESTFLAGS="-test.run Test(DockerSwarmSuite|DockerDaemonSuite|DockerExternalVolumeSuite)/" run_tests &
  317. c=0
  318. for job in $(jobs -p); do
  319. wait ${job} || c=$?
  320. done
  321. exit $c
  322. '''
  323. }
  324. post {
  325. always {
  326. junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true
  327. }
  328. }
  329. }
  330. }
  331. post {
  332. always {
  333. sh '''
  334. echo "Ensuring container killed."
  335. cids=$(docker ps -aq -f name=docker-pr${BUILD_NUMBER}-*)
  336. [ -n "$cids" ] && docker rm -vf $cids || true
  337. '''
  338. sh '''
  339. echo "Chowning /workspace to jenkins user"
  340. docker run --rm -v "$WORKSPACE:/workspace" busybox chown -R "$(id -u):$(id -g)" /workspace
  341. '''
  342. catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') {
  343. sh '''
  344. bundleName=amd64
  345. echo "Creating ${bundleName}-bundles.tar.gz"
  346. # exclude overlay2 directories
  347. 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
  348. '''
  349. archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
  350. }
  351. }
  352. cleanup {
  353. sh 'make clean'
  354. deleteDir()
  355. }
  356. }
  357. }
  358. stage('rootless') {
  359. when {
  360. beforeAgent true
  361. expression { params.rootless }
  362. }
  363. agent { label 'amd64 && ubuntu-1804 && overlay2' }
  364. stages {
  365. stage("Print info") {
  366. steps {
  367. sh 'docker version'
  368. sh 'docker info'
  369. sh '''
  370. echo "check-config.sh version: ${CHECK_CONFIG_COMMIT}"
  371. curl -fsSL -o ${WORKSPACE}/check-config.sh "https://raw.githubusercontent.com/moby/moby/${CHECK_CONFIG_COMMIT}/contrib/check-config.sh" \
  372. && bash ${WORKSPACE}/check-config.sh || true
  373. '''
  374. }
  375. }
  376. stage("Build dev image") {
  377. steps {
  378. sh '''
  379. docker build --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} .
  380. '''
  381. }
  382. }
  383. stage("Integration tests") {
  384. environment {
  385. DOCKER_ROOTLESS = '1'
  386. TEST_SKIP_INTEGRATION_CLI = '1'
  387. }
  388. steps {
  389. sh '''
  390. docker run --rm -t --privileged \
  391. -v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
  392. --name docker-pr$BUILD_NUMBER \
  393. -e DOCKER_GITCOMMIT=${GIT_COMMIT} \
  394. -e DOCKER_GRAPHDRIVER \
  395. -e DOCKER_EXPERIMENTAL \
  396. -e DOCKER_ROOTLESS \
  397. -e TEST_SKIP_INTEGRATION_CLI \
  398. -e TIMEOUT \
  399. -e VALIDATE_REPO=${GIT_URL} \
  400. -e VALIDATE_BRANCH=${CHANGE_TARGET} \
  401. docker:${GIT_COMMIT} \
  402. hack/make.sh \
  403. dynbinary \
  404. test-integration
  405. '''
  406. }
  407. post {
  408. always {
  409. junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true
  410. }
  411. }
  412. }
  413. }
  414. post {
  415. always {
  416. sh '''
  417. echo "Ensuring container killed."
  418. docker rm -vf docker-pr$BUILD_NUMBER || true
  419. '''
  420. sh '''
  421. echo "Chowning /workspace to jenkins user"
  422. docker run --rm -v "$WORKSPACE:/workspace" busybox chown -R "$(id -u):$(id -g)" /workspace
  423. '''
  424. catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') {
  425. sh '''
  426. bundleName=amd64-rootless
  427. echo "Creating ${bundleName}-bundles.tar.gz"
  428. # exclude overlay2 directories
  429. 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
  430. '''
  431. archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
  432. }
  433. }
  434. cleanup {
  435. sh 'make clean'
  436. deleteDir()
  437. }
  438. }
  439. }
  440. stage('cgroup2') {
  441. when {
  442. beforeAgent true
  443. expression { params.cgroup2 }
  444. }
  445. agent { label 'amd64 && ubuntu-2004 && cgroup2' }
  446. stages {
  447. stage("Print info") {
  448. steps {
  449. sh 'docker version'
  450. sh 'docker info'
  451. }
  452. }
  453. stage("Build dev image") {
  454. steps {
  455. sh '''
  456. docker build --force-rm --build-arg APT_MIRROR --build-arg SYSTEMD=true -t docker:${GIT_COMMIT} .
  457. '''
  458. }
  459. }
  460. stage("Integration tests") {
  461. environment {
  462. DOCKER_SYSTEMD = '1' // recommended cgroup driver for v2
  463. TEST_SKIP_INTEGRATION_CLI = '1' // CLI tests do not support v2
  464. }
  465. steps {
  466. sh '''
  467. docker run --rm -t --privileged \
  468. -v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
  469. --name docker-pr$BUILD_NUMBER \
  470. -e DOCKER_GITCOMMIT=${GIT_COMMIT} \
  471. -e DOCKER_GRAPHDRIVER \
  472. -e DOCKER_EXPERIMENTAL \
  473. -e DOCKER_SYSTEMD \
  474. -e TEST_SKIP_INTEGRATION_CLI \
  475. -e TIMEOUT \
  476. -e VALIDATE_REPO=${GIT_URL} \
  477. -e VALIDATE_BRANCH=${CHANGE_TARGET} \
  478. docker:${GIT_COMMIT} \
  479. hack/make.sh \
  480. dynbinary \
  481. test-integration
  482. '''
  483. }
  484. post {
  485. always {
  486. junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true
  487. }
  488. }
  489. }
  490. }
  491. post {
  492. always {
  493. sh '''
  494. echo "Ensuring container killed."
  495. docker rm -vf docker-pr$BUILD_NUMBER || true
  496. '''
  497. sh '''
  498. echo "Chowning /workspace to jenkins user"
  499. docker run --rm -v "$WORKSPACE:/workspace" busybox chown -R "$(id -u):$(id -g)" /workspace
  500. '''
  501. catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') {
  502. sh '''
  503. bundleName=amd64-cgroup2
  504. echo "Creating ${bundleName}-bundles.tar.gz"
  505. # exclude overlay2 directories
  506. 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
  507. '''
  508. archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
  509. }
  510. }
  511. cleanup {
  512. sh 'make clean'
  513. deleteDir()
  514. }
  515. }
  516. }
  517. stage('s390x') {
  518. when {
  519. beforeAgent true
  520. // Skip this stage on PRs unless the checkbox is selected
  521. anyOf {
  522. not { changeRequest() }
  523. expression { params.s390x }
  524. }
  525. }
  526. agent { label 's390x-ubuntu-2004' }
  527. stages {
  528. stage("Print info") {
  529. steps {
  530. sh 'docker version'
  531. sh 'docker info'
  532. sh '''
  533. echo "check-config.sh version: ${CHECK_CONFIG_COMMIT}"
  534. curl -fsSL -o ${WORKSPACE}/check-config.sh "https://raw.githubusercontent.com/moby/moby/${CHECK_CONFIG_COMMIT}/contrib/check-config.sh" \
  535. && bash ${WORKSPACE}/check-config.sh || true
  536. '''
  537. }
  538. }
  539. stage("Build dev image") {
  540. steps {
  541. sh '''
  542. docker build --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} .
  543. '''
  544. }
  545. }
  546. stage("Unit tests") {
  547. steps {
  548. sh '''
  549. sudo modprobe ip6table_filter
  550. '''
  551. sh '''
  552. docker run --rm -t --privileged \
  553. -v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
  554. --name docker-pr$BUILD_NUMBER \
  555. -e DOCKER_EXPERIMENTAL \
  556. -e DOCKER_GITCOMMIT=${GIT_COMMIT} \
  557. -e DOCKER_GRAPHDRIVER \
  558. -e VALIDATE_REPO=${GIT_URL} \
  559. -e VALIDATE_BRANCH=${CHANGE_TARGET} \
  560. docker:${GIT_COMMIT} \
  561. hack/test/unit
  562. '''
  563. }
  564. post {
  565. always {
  566. junit testResults: 'bundles/junit-report*.xml', allowEmptyResults: true
  567. }
  568. }
  569. }
  570. stage("Integration tests") {
  571. environment { TEST_SKIP_INTEGRATION_CLI = '1' }
  572. steps {
  573. sh '''
  574. docker run --rm -t --privileged \
  575. -v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
  576. --name docker-pr$BUILD_NUMBER \
  577. -e DOCKER_EXPERIMENTAL \
  578. -e DOCKER_GITCOMMIT=${GIT_COMMIT} \
  579. -e DOCKER_GRAPHDRIVER \
  580. -e TESTDEBUG \
  581. -e TEST_SKIP_INTEGRATION_CLI \
  582. -e TIMEOUT \
  583. -e VALIDATE_REPO=${GIT_URL} \
  584. -e VALIDATE_BRANCH=${CHANGE_TARGET} \
  585. docker:${GIT_COMMIT} \
  586. hack/make.sh \
  587. dynbinary \
  588. test-integration
  589. '''
  590. }
  591. post {
  592. always {
  593. junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true
  594. }
  595. }
  596. }
  597. }
  598. post {
  599. always {
  600. sh '''
  601. echo "Ensuring container killed."
  602. docker rm -vf docker-pr$BUILD_NUMBER || true
  603. '''
  604. sh '''
  605. echo "Chowning /workspace to jenkins user"
  606. docker run --rm -v "$WORKSPACE:/workspace" busybox chown -R "$(id -u):$(id -g)" /workspace
  607. '''
  608. catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') {
  609. sh '''
  610. bundleName=s390x-integration
  611. echo "Creating ${bundleName}-bundles.tar.gz"
  612. # exclude overlay2 directories
  613. 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
  614. '''
  615. archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
  616. }
  617. }
  618. cleanup {
  619. sh 'make clean'
  620. deleteDir()
  621. }
  622. }
  623. }
  624. stage('s390x integration-cli') {
  625. when {
  626. beforeAgent true
  627. not { changeRequest() }
  628. expression { params.s390x }
  629. }
  630. agent { label 's390x-ubuntu-2004' }
  631. stages {
  632. stage("Print info") {
  633. steps {
  634. sh 'docker version'
  635. sh 'docker info'
  636. sh '''
  637. echo "check-config.sh version: ${CHECK_CONFIG_COMMIT}"
  638. curl -fsSL -o ${WORKSPACE}/check-config.sh "https://raw.githubusercontent.com/moby/moby/${CHECK_CONFIG_COMMIT}/contrib/check-config.sh" \
  639. && bash ${WORKSPACE}/check-config.sh || true
  640. '''
  641. }
  642. }
  643. stage("Build dev image") {
  644. steps {
  645. sh '''
  646. docker build --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} .
  647. '''
  648. }
  649. }
  650. stage("Integration-cli tests") {
  651. environment { TEST_SKIP_INTEGRATION = '1' }
  652. steps {
  653. sh '''
  654. docker run --rm -t --privileged \
  655. -v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
  656. --name docker-pr$BUILD_NUMBER \
  657. -e DOCKER_GITCOMMIT=${GIT_COMMIT} \
  658. -e DOCKER_GRAPHDRIVER \
  659. -e TEST_SKIP_INTEGRATION \
  660. -e TIMEOUT \
  661. -e VALIDATE_REPO=${GIT_URL} \
  662. -e VALIDATE_BRANCH=${CHANGE_TARGET} \
  663. docker:${GIT_COMMIT} \
  664. hack/make.sh \
  665. dynbinary \
  666. test-integration
  667. '''
  668. }
  669. post {
  670. always {
  671. junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true
  672. }
  673. }
  674. }
  675. }
  676. post {
  677. always {
  678. sh '''
  679. echo "Ensuring container killed."
  680. docker rm -vf docker-pr$BUILD_NUMBER || true
  681. '''
  682. sh '''
  683. echo "Chowning /workspace to jenkins user"
  684. docker run --rm -v "$WORKSPACE:/workspace" busybox chown -R "$(id -u):$(id -g)" /workspace
  685. '''
  686. catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') {
  687. sh '''
  688. bundleName=s390x-integration-cli
  689. echo "Creating ${bundleName}-bundles.tar.gz"
  690. # exclude overlay2 directories
  691. 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
  692. '''
  693. archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
  694. }
  695. }
  696. cleanup {
  697. sh 'make clean'
  698. deleteDir()
  699. }
  700. }
  701. }
  702. stage('ppc64le') {
  703. when {
  704. beforeAgent true
  705. // Skip this stage on PRs unless the checkbox is selected
  706. anyOf {
  707. not { changeRequest() }
  708. expression { params.ppc64le }
  709. }
  710. }
  711. agent { label 'ppc64le-ubuntu-1604' }
  712. // ppc64le machines run on Docker 18.06, and buildkit has some
  713. // bugs on that version. Build and use buildx instead.
  714. environment {
  715. USE_BUILDX = '1'
  716. DOCKER_BUILDKIT = '0'
  717. }
  718. stages {
  719. stage("Print info") {
  720. steps {
  721. sh 'docker version'
  722. sh 'docker info'
  723. sh '''
  724. echo "check-config.sh version: ${CHECK_CONFIG_COMMIT}"
  725. curl -fsSL -o ${WORKSPACE}/check-config.sh "https://raw.githubusercontent.com/moby/moby/${CHECK_CONFIG_COMMIT}/contrib/check-config.sh" \
  726. && bash ${WORKSPACE}/check-config.sh || true
  727. '''
  728. }
  729. }
  730. stage("Build dev image") {
  731. steps {
  732. sh '''
  733. make bundles/buildx
  734. bundles/buildx build --load --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} .
  735. '''
  736. }
  737. }
  738. stage("Unit tests") {
  739. steps {
  740. sh '''
  741. sudo modprobe ip6table_filter
  742. '''
  743. sh '''
  744. docker run --rm -t --privileged \
  745. -v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
  746. --name docker-pr$BUILD_NUMBER \
  747. -e DOCKER_EXPERIMENTAL \
  748. -e DOCKER_GITCOMMIT=${GIT_COMMIT} \
  749. -e DOCKER_GRAPHDRIVER \
  750. -e VALIDATE_REPO=${GIT_URL} \
  751. -e VALIDATE_BRANCH=${CHANGE_TARGET} \
  752. docker:${GIT_COMMIT} \
  753. hack/test/unit
  754. '''
  755. }
  756. post {
  757. always {
  758. junit testResults: 'bundles/junit-report*.xml', allowEmptyResults: true
  759. }
  760. }
  761. }
  762. stage("Integration tests") {
  763. environment { TEST_SKIP_INTEGRATION_CLI = '1' }
  764. steps {
  765. sh '''
  766. docker run --rm -t --privileged \
  767. -v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
  768. --name docker-pr$BUILD_NUMBER \
  769. -e DOCKER_EXPERIMENTAL \
  770. -e DOCKER_GITCOMMIT=${GIT_COMMIT} \
  771. -e DOCKER_GRAPHDRIVER \
  772. -e TESTDEBUG \
  773. -e TEST_SKIP_INTEGRATION_CLI \
  774. -e TIMEOUT \
  775. -e VALIDATE_REPO=${GIT_URL} \
  776. -e VALIDATE_BRANCH=${CHANGE_TARGET} \
  777. docker:${GIT_COMMIT} \
  778. hack/make.sh \
  779. dynbinary \
  780. test-integration
  781. '''
  782. }
  783. post {
  784. always {
  785. junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true
  786. }
  787. }
  788. }
  789. }
  790. post {
  791. always {
  792. sh '''
  793. echo "Ensuring container killed."
  794. docker rm -vf docker-pr$BUILD_NUMBER || true
  795. '''
  796. sh '''
  797. echo "Chowning /workspace to jenkins user"
  798. docker run --rm -v "$WORKSPACE:/workspace" busybox chown -R "$(id -u):$(id -g)" /workspace
  799. '''
  800. catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') {
  801. sh '''
  802. bundleName=ppc64le-integration
  803. echo "Creating ${bundleName}-bundles.tar.gz"
  804. # exclude overlay2 directories
  805. 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
  806. '''
  807. archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
  808. }
  809. }
  810. cleanup {
  811. sh 'make clean'
  812. deleteDir()
  813. }
  814. }
  815. }
  816. stage('ppc64le integration-cli') {
  817. when {
  818. beforeAgent true
  819. not { changeRequest() }
  820. expression { params.ppc64le }
  821. }
  822. agent { label 'ppc64le-ubuntu-1604' }
  823. // ppc64le machines run on Docker 18.06, and buildkit has some
  824. // bugs on that version. Build and use buildx instead.
  825. environment {
  826. USE_BUILDX = '1'
  827. DOCKER_BUILDKIT = '0'
  828. }
  829. stages {
  830. stage("Print info") {
  831. steps {
  832. sh 'docker version'
  833. sh 'docker info'
  834. sh '''
  835. echo "check-config.sh version: ${CHECK_CONFIG_COMMIT}"
  836. curl -fsSL -o ${WORKSPACE}/check-config.sh "https://raw.githubusercontent.com/moby/moby/${CHECK_CONFIG_COMMIT}/contrib/check-config.sh" \
  837. && bash ${WORKSPACE}/check-config.sh || true
  838. '''
  839. }
  840. }
  841. stage("Build dev image") {
  842. steps {
  843. sh '''
  844. make bundles/buildx
  845. bundles/buildx build --load --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} .
  846. '''
  847. }
  848. }
  849. stage("Integration-cli tests") {
  850. environment { TEST_SKIP_INTEGRATION = '1' }
  851. steps {
  852. sh '''
  853. docker run --rm -t --privileged \
  854. -v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
  855. --name docker-pr$BUILD_NUMBER \
  856. -e DOCKER_GITCOMMIT=${GIT_COMMIT} \
  857. -e DOCKER_GRAPHDRIVER \
  858. -e TEST_SKIP_INTEGRATION \
  859. -e TIMEOUT \
  860. -e VALIDATE_REPO=${GIT_URL} \
  861. -e VALIDATE_BRANCH=${CHANGE_TARGET} \
  862. docker:${GIT_COMMIT} \
  863. hack/make.sh \
  864. dynbinary \
  865. test-integration
  866. '''
  867. }
  868. post {
  869. always {
  870. junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true
  871. }
  872. }
  873. }
  874. }
  875. post {
  876. always {
  877. sh '''
  878. echo "Ensuring container killed."
  879. docker rm -vf docker-pr$BUILD_NUMBER || true
  880. '''
  881. sh '''
  882. echo "Chowning /workspace to jenkins user"
  883. docker run --rm -v "$WORKSPACE:/workspace" busybox chown -R "$(id -u):$(id -g)" /workspace
  884. '''
  885. catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') {
  886. sh '''
  887. bundleName=ppc64le-integration-cli
  888. echo "Creating ${bundleName}-bundles.tar.gz"
  889. # exclude overlay2 directories
  890. 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
  891. '''
  892. archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
  893. }
  894. }
  895. cleanup {
  896. sh 'make clean'
  897. deleteDir()
  898. }
  899. }
  900. }
  901. stage('arm64') {
  902. when {
  903. beforeAgent true
  904. expression { params.arm64 }
  905. }
  906. agent { label 'arm64 && ubuntu-2004' }
  907. environment {
  908. TEST_SKIP_INTEGRATION_CLI = '1'
  909. }
  910. stages {
  911. stage("Print info") {
  912. steps {
  913. sh 'docker version'
  914. sh 'docker info'
  915. sh '''
  916. echo "check-config.sh version: ${CHECK_CONFIG_COMMIT}"
  917. curl -fsSL -o ${WORKSPACE}/check-config.sh "https://raw.githubusercontent.com/moby/moby/${CHECK_CONFIG_COMMIT}/contrib/check-config.sh" \
  918. && bash ${WORKSPACE}/check-config.sh || true
  919. '''
  920. }
  921. }
  922. stage("Build dev image") {
  923. steps {
  924. sh 'docker build --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} .'
  925. }
  926. }
  927. stage("Unit tests") {
  928. steps {
  929. sh '''
  930. sudo modprobe ip6table_filter
  931. '''
  932. sh '''
  933. docker run --rm -t --privileged \
  934. -v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
  935. --name docker-pr$BUILD_NUMBER \
  936. -e DOCKER_EXPERIMENTAL \
  937. -e DOCKER_GITCOMMIT=${GIT_COMMIT} \
  938. -e DOCKER_GRAPHDRIVER \
  939. -e VALIDATE_REPO=${GIT_URL} \
  940. -e VALIDATE_BRANCH=${CHANGE_TARGET} \
  941. docker:${GIT_COMMIT} \
  942. hack/test/unit
  943. '''
  944. }
  945. post {
  946. always {
  947. junit testResults: 'bundles/junit-report*.xml', allowEmptyResults: true
  948. }
  949. }
  950. }
  951. stage("Integration tests") {
  952. environment { TEST_SKIP_INTEGRATION_CLI = '1' }
  953. steps {
  954. sh '''
  955. docker run --rm -t --privileged \
  956. -v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
  957. --name docker-pr$BUILD_NUMBER \
  958. -e DOCKER_EXPERIMENTAL \
  959. -e DOCKER_GITCOMMIT=${GIT_COMMIT} \
  960. -e DOCKER_GRAPHDRIVER \
  961. -e TESTDEBUG \
  962. -e TEST_SKIP_INTEGRATION_CLI \
  963. -e TIMEOUT \
  964. -e VALIDATE_REPO=${GIT_URL} \
  965. -e VALIDATE_BRANCH=${CHANGE_TARGET} \
  966. docker:${GIT_COMMIT} \
  967. hack/make.sh \
  968. dynbinary \
  969. test-integration
  970. '''
  971. }
  972. post {
  973. always {
  974. junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true
  975. }
  976. }
  977. }
  978. }
  979. post {
  980. always {
  981. sh '''
  982. echo "Ensuring container killed."
  983. docker rm -vf docker-pr$BUILD_NUMBER || true
  984. '''
  985. sh '''
  986. echo "Chowning /workspace to jenkins user"
  987. docker run --rm -v "$WORKSPACE:/workspace" busybox chown -R "$(id -u):$(id -g)" /workspace
  988. '''
  989. catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') {
  990. sh '''
  991. bundleName=arm64-integration
  992. echo "Creating ${bundleName}-bundles.tar.gz"
  993. # exclude overlay2 directories
  994. 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
  995. '''
  996. archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
  997. }
  998. }
  999. cleanup {
  1000. sh 'make clean'
  1001. deleteDir()
  1002. }
  1003. }
  1004. }
  1005. stage('win-RS1') {
  1006. when {
  1007. beforeAgent true
  1008. // Skip this stage on PRs unless the windowsRS1 checkbox is selected
  1009. anyOf {
  1010. not { changeRequest() }
  1011. expression { params.windowsRS1 }
  1012. }
  1013. }
  1014. environment {
  1015. DOCKER_BUILDKIT = '0'
  1016. DOCKER_DUT_DEBUG = '1'
  1017. SKIP_VALIDATION_TESTS = '1'
  1018. SOURCES_DRIVE = 'd'
  1019. SOURCES_SUBDIR = 'gopath'
  1020. TESTRUN_DRIVE = 'd'
  1021. TESTRUN_SUBDIR = "CI"
  1022. WINDOWS_BASE_IMAGE = 'mcr.microsoft.com/windows/servercore'
  1023. WINDOWS_BASE_IMAGE_TAG = 'ltsc2016'
  1024. }
  1025. agent {
  1026. node {
  1027. customWorkspace 'd:\\gopath\\src\\github.com\\docker\\docker'
  1028. label 'windows-2016'
  1029. }
  1030. }
  1031. stages {
  1032. stage("Print info") {
  1033. steps {
  1034. sh 'docker version'
  1035. sh 'docker info'
  1036. }
  1037. }
  1038. stage("Run tests") {
  1039. steps {
  1040. powershell '''
  1041. $ErrorActionPreference = 'Stop'
  1042. [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
  1043. Invoke-WebRequest https://github.com/moby/docker-ci-zap/blob/master/docker-ci-zap.exe?raw=true -OutFile C:/Windows/System32/docker-ci-zap.exe
  1044. ./hack/ci/windows.ps1
  1045. exit $LastExitCode
  1046. '''
  1047. }
  1048. }
  1049. }
  1050. post {
  1051. always {
  1052. junit testResults: 'bundles/junit-report-*.xml', allowEmptyResults: true
  1053. catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') {
  1054. powershell '''
  1055. cd $env:WORKSPACE
  1056. $bundleName="windowsRS1-integration"
  1057. Write-Host -ForegroundColor Green "Creating ${bundleName}-bundles.zip"
  1058. # archiveArtifacts does not support env-vars to , so save the artifacts in a fixed location
  1059. Compress-Archive -Path "bundles/CIDUT.out", "bundles/CIDUT.err", "bundles/junit-report-*.xml" -CompressionLevel Optimal -DestinationPath "${bundleName}-bundles.zip"
  1060. '''
  1061. archiveArtifacts artifacts: '*-bundles.zip', allowEmptyArchive: true
  1062. }
  1063. }
  1064. cleanup {
  1065. sh 'make clean'
  1066. deleteDir()
  1067. }
  1068. }
  1069. }
  1070. stage('win-RS5') {
  1071. when {
  1072. beforeAgent true
  1073. expression { params.windowsRS5 }
  1074. }
  1075. environment {
  1076. DOCKER_BUILDKIT = '0'
  1077. DOCKER_DUT_DEBUG = '1'
  1078. SKIP_VALIDATION_TESTS = '1'
  1079. SOURCES_DRIVE = 'd'
  1080. SOURCES_SUBDIR = 'gopath'
  1081. TESTRUN_DRIVE = 'd'
  1082. TESTRUN_SUBDIR = "CI"
  1083. WINDOWS_BASE_IMAGE = 'mcr.microsoft.com/windows/servercore'
  1084. WINDOWS_BASE_IMAGE_TAG = 'ltsc2019'
  1085. }
  1086. agent {
  1087. node {
  1088. customWorkspace 'd:\\gopath\\src\\github.com\\docker\\docker'
  1089. label 'windows-2019'
  1090. }
  1091. }
  1092. stages {
  1093. stage("Print info") {
  1094. steps {
  1095. sh 'docker version'
  1096. sh 'docker info'
  1097. }
  1098. }
  1099. stage("Run tests") {
  1100. steps {
  1101. powershell '''
  1102. $ErrorActionPreference = 'Stop'
  1103. Invoke-WebRequest https://github.com/moby/docker-ci-zap/blob/master/docker-ci-zap.exe?raw=true -OutFile C:/Windows/System32/docker-ci-zap.exe
  1104. ./hack/ci/windows.ps1
  1105. exit $LastExitCode
  1106. '''
  1107. }
  1108. }
  1109. }
  1110. post {
  1111. always {
  1112. junit testResults: 'bundles/junit-report-*.xml', allowEmptyResults: true
  1113. catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') {
  1114. powershell '''
  1115. cd $env:WORKSPACE
  1116. $bundleName="windowsRS5-integration"
  1117. Write-Host -ForegroundColor Green "Creating ${bundleName}-bundles.zip"
  1118. # archiveArtifacts does not support env-vars to , so save the artifacts in a fixed location
  1119. Compress-Archive -Path "bundles/CIDUT.out", "bundles/CIDUT.err", "bundles/junit-report-*.xml" -CompressionLevel Optimal -DestinationPath "${bundleName}-bundles.zip"
  1120. '''
  1121. archiveArtifacts artifacts: '*-bundles.zip', allowEmptyArchive: true
  1122. }
  1123. }
  1124. cleanup {
  1125. sh 'make clean'
  1126. deleteDir()
  1127. }
  1128. }
  1129. }
  1130. stage('win-2022') {
  1131. when {
  1132. beforeAgent true
  1133. expression { params.windows2022 }
  1134. }
  1135. environment {
  1136. DOCKER_BUILDKIT = '0'
  1137. DOCKER_DUT_DEBUG = '1'
  1138. SKIP_VALIDATION_TESTS = '1'
  1139. SOURCES_DRIVE = 'd'
  1140. SOURCES_SUBDIR = 'gopath'
  1141. TESTRUN_DRIVE = 'd'
  1142. TESTRUN_SUBDIR = "CI"
  1143. WINDOWS_BASE_IMAGE = 'mcr.microsoft.com/windows/servercore'
  1144. // Available tags can be found at https://mcr.microsoft.com/v2/windows/servercore/tags/list
  1145. WINDOWS_BASE_IMAGE_TAG = 'ltsc2022'
  1146. }
  1147. agent {
  1148. node {
  1149. customWorkspace 'd:\\gopath\\src\\github.com\\docker\\docker'
  1150. label 'windows-2022'
  1151. }
  1152. }
  1153. stages {
  1154. stage("Print info") {
  1155. steps {
  1156. sh 'docker version'
  1157. sh 'docker info'
  1158. }
  1159. }
  1160. stage("Run tests") {
  1161. steps {
  1162. powershell '''
  1163. $ErrorActionPreference = 'Stop'
  1164. Invoke-WebRequest https://github.com/moby/docker-ci-zap/blob/master/docker-ci-zap.exe?raw=true -OutFile C:/Windows/System32/docker-ci-zap.exe
  1165. ./hack/ci/windows.ps1
  1166. exit $LastExitCode
  1167. '''
  1168. }
  1169. }
  1170. }
  1171. post {
  1172. always {
  1173. junit testResults: 'bundles/junit-report-*.xml', allowEmptyResults: true
  1174. catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.zip') {
  1175. powershell '''
  1176. cd $env:WORKSPACE
  1177. $bundleName="win-2022-integration"
  1178. Write-Host -ForegroundColor Green "Creating ${bundleName}-bundles.zip"
  1179. # archiveArtifacts does not support env-vars to , so save the artifacts in a fixed location
  1180. Compress-Archive -Path "bundles/CIDUT.out", "bundles/CIDUT.err", "bundles/junit-report-*.xml" -CompressionLevel Optimal -DestinationPath "${bundleName}-bundles.zip"
  1181. '''
  1182. archiveArtifacts artifacts: '*-bundles.zip', allowEmptyArchive: true
  1183. }
  1184. }
  1185. cleanup {
  1186. sh 'make clean'
  1187. deleteDir()
  1188. }
  1189. }
  1190. }
  1191. stage('win-2022-c8d') {
  1192. when {
  1193. beforeAgent true
  1194. expression { params.windows2022containerd }
  1195. }
  1196. environment {
  1197. DOCKER_BUILDKIT = '0'
  1198. DOCKER_DUT_DEBUG = '1'
  1199. SKIP_VALIDATION_TESTS = '1'
  1200. SOURCES_DRIVE = 'd'
  1201. SOURCES_SUBDIR = 'gopath'
  1202. TESTRUN_DRIVE = 'd'
  1203. TESTRUN_SUBDIR = "CI"
  1204. WINDOWS_BASE_IMAGE = 'mcr.microsoft.com/windows/servercore'
  1205. // Available tags can be found at https://mcr.microsoft.com/v2/windows/servercore/tags/list
  1206. WINDOWS_BASE_IMAGE_TAG = 'ltsc2022'
  1207. DOCKER_WINDOWS_CONTAINERD_RUNTIME = '1'
  1208. }
  1209. agent {
  1210. node {
  1211. customWorkspace 'd:\\gopath\\src\\github.com\\docker\\docker'
  1212. label 'windows-2022'
  1213. }
  1214. }
  1215. stages {
  1216. stage("Print info") {
  1217. steps {
  1218. sh 'docker version'
  1219. sh 'docker info'
  1220. }
  1221. }
  1222. stage("Run tests") {
  1223. steps {
  1224. powershell '''
  1225. $ErrorActionPreference = 'Stop'
  1226. Invoke-WebRequest https://github.com/moby/docker-ci-zap/blob/master/docker-ci-zap.exe?raw=true -OutFile C:/Windows/System32/docker-ci-zap.exe
  1227. ./hack/ci/windows.ps1
  1228. exit $LastExitCode
  1229. '''
  1230. }
  1231. }
  1232. }
  1233. post {
  1234. always {
  1235. junit testResults: 'bundles/junit-report-*.xml', allowEmptyResults: true
  1236. catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.zip') {
  1237. powershell '''
  1238. cd $env:WORKSPACE
  1239. $bundleName="win-2022-c8d-integration"
  1240. Write-Host -ForegroundColor Green "Creating ${bundleName}-bundles.zip"
  1241. # archiveArtifacts does not support env-vars to , so save the artifacts in a fixed location
  1242. Compress-Archive -Path "bundles/CIDUT.out", "bundles/CIDUT.err", "bundles/containerd.out", "bundles/containerd.err", "bundles/junit-report-*.xml" -CompressionLevel Optimal -DestinationPath "${bundleName}-bundles.zip"
  1243. '''
  1244. archiveArtifacts artifacts: '*-bundles.zip', allowEmptyArchive: true
  1245. }
  1246. }
  1247. cleanup {
  1248. sh 'make clean'
  1249. deleteDir()
  1250. }
  1251. }
  1252. }
  1253. }
  1254. }
  1255. }
  1256. }