diff --git a/README.md b/README.md index 02a468c..5203251 100644 --- a/README.md +++ b/README.md @@ -78,3 +78,4 @@ postgres96Lint | Whether or not to forbid newer postgres features | `true` publishingE2ETests | Whether or not to run the Publishing end-to-end tests. | `false` sassLint | Whether or not to run the SASS linter | `true` skipDeployToIntegration | Whether or not to skip the "Deploy to integration" stage | `false` +yarnInstall | Whether or not to install Yarn dependencies if a yarn.lock file is found | `true` diff --git a/vars/govuk.groovy b/vars/govuk.groovy index 15b979e..e79bd52 100644 --- a/vars/govuk.groovy +++ b/vars/govuk.groovy @@ -166,6 +166,12 @@ def nonDockerBuildTasks(options, jobName, repoName) { } } + if (options.yarnInstall != false && fileExists(file: "yarn.lock")) { + stage("yarn install") { + sh("yarn install --frozen-lockfile") + } + } + if (hasAssets() && hasSCSSLint() && options.sassLint != false) { stage("Lint SCSS") { lintSCSS()