From be7db4d2c6d5179678110bacaca2228b31383607 Mon Sep 17 00:00:00 2001 From: Arjun Attam Date: Wed, 12 Aug 2020 14:01:55 -0700 Subject: [PATCH] docs(ci): add sample config for jenkins (#3398) --- docs/ci.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/ci.md b/docs/ci.md index 819558b598..63643eb77f 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -11,6 +11,7 @@ configurations for common CI providers. * [Azure Pipelines](#azure-pipelines) * [Travis CI](#travis-ci) * [CircleCI](#circleci) + * [Jenkins](#jenkins) * [Bitbucket Pipelines](#bitbucket-pipelines) * [GitLab CI](#gitlab-ci) - [Caching browsers](#caching-browsers) @@ -170,6 +171,25 @@ We run our tests on CircleCI, with our [pre-built Docker image](docker/README.md This is likely caused by Jest autodetecting the number of processes on the entire machine (`36`) rather than the number allowed to your container (`2`). To fix this, set `jest --maxWorkers=2` in your test command. +### Jenkins + +Jenkins supports Docker agents for pipelines. Use the [Playwright Docker image](docker/README.md) +to run tests on Jenkins. + +```groovy +pipeline { + agent { docker { image 'mcr.microsoft.com/playwright:bionic' } } + stages { + stage('e2e-tests') { + steps { + sh 'npm install' + sh 'npm run test' + } + } + } +} +``` + ### Bitbucket Pipelines Bitbucket Pipelines can use public [Docker images as build environments](https://confluence.atlassian.com/bitbucket/use-docker-images-as-build-environments-792298897.html). To run Playwright tests on Bitbucket, use our public Docker image ([see Dockerfile](docker/README.md)).