-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dockerfile: Check yarn.lock only on CI servers (#1076)
- Loading branch information
Showing
4 changed files
with
32 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,6 @@ steps: | |
- build | ||
- '--build-arg' | ||
- NPM_SCRIPT=test | ||
- '--build-arg' | ||
- YARN_FROZEN_LOCKFILE=true | ||
- . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
web/packages/build/scripts/yarn-install-frozen-lockfile.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
# Install JavaScript dependencies and manually check if yarn.lock needs an update. | ||
# Yarn v1 doesn't respect the --frozen-lockfile flag when using workspaces. | ||
# https://github.com/yarnpkg/yarn/issues/4098 | ||
|
||
message="yarn.lock needs an update. Run yarn install, verify that correct dependencies were \ | ||
installed and commit the updated version of yarn.lock. Make sure you have the packages/webapps.e \ | ||
submodule initialized and updated first." | ||
|
||
cp yarn.lock yarn-before-install.lock | ||
yarn install | ||
git diff --no-index --exit-code yarn-before-install.lock yarn.lock || | ||
{ echo "$message" ; exit 1; } |