From 1fe72c7212559bab72ac0892f6298b88b1fbcfbb Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Fri, 5 Feb 2021 16:12:53 -0500 Subject: [PATCH] Attempt to run CI in stages --- Jenkinsfile | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6f9d765..142298e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,11 +12,13 @@ pipeline { } stage("Test PHP 7.4") { steps { - docker.image("memcached:latest").withRun("-p 11212:11211") { c -> - docker.image("redis:latest").withRun("-p 6380:6379") { d -> - docker.image("php:7.4").withRun("-e REDIS_HOST=redis -e REDIS_PORT=11212 -e MEMCACHED_HOST=mem -e MEMCACHED_PORT=6380 --link ${d.id}:redis --link ${c.id}:mem") { p -> - sh "sh build/docker_install.sh" - sh "php ./vendor/bin/phpunit -c build --no-coverage --colors=never" + node { + docker.image("memcached:latest").withRun("-p 11212:11211") { c -> + docker.image("redis:latest").withRun("-p 6380:6379") { d -> + docker.image("php:7.4").withRun("-e REDIS_HOST=redis -e REDIS_PORT=11212 -e MEMCACHED_HOST=mem -e MEMCACHED_PORT=6380 --link ${d.id}:redis --link ${c.id}:mem") { p -> + sh "sh build/docker_install.sh" + sh "php ./vendor/bin/phpunit -c build --no-coverage --colors=never" + } } } } @@ -24,24 +26,28 @@ pipeline { } stage("Test PHP 8") { steps { - docker.image("memcached:latest").withRun("-p 11212:11211") { c -> - docker.image("redis:latest").withRun("-p 6380:6379") { d -> - docker.image("php:8").withRun("-e REDIS_HOST=redis -e REDIS_PORT=11212 -e MEMCACHED_HOST=mem -e MEMCACHED_PORT=6380 --link ${d.id}:redis --link ${c.id}:mem") { p -> - sh "sh build/docker_install.sh" - sh "php ./vendor/bin/phpunit -c build --no-coverage --colors=never" + node { + docker.image("memcached:latest").withRun("-p 11212:11211") { c -> + docker.image("redis:latest").withRun("-p 6380:6379") { d -> + docker.image("php:8").withRun("-e REDIS_HOST=redis -e REDIS_PORT=11212 -e MEMCACHED_HOST=mem -e MEMCACHED_PORT=6380 --link ${d.id}:redis --link ${c.id}:mem") { p -> + sh "sh build/docker_install.sh" + sh "php ./vendor/bin/phpunit -c build --no-coverage --colors=never" + } } } } } } - stage("Coverage") { - steps { - sh 'php composer.phar run-script coverage' - step([ - $class: 'CloverPublisher', - cloverReportDir: '', - cloverReportFileName: 'build/logs/clover.xml', - ]) + post { + success { + steps { + sh 'php composer.phar run-script coverage' + step([ + $class: 'CloverPublisher', + cloverReportDir: '', + cloverReportFileName: 'build/logs/clover.xml', + ]) + } } } }