Created
January 10, 2017 19:21
-
-
Save urjitbhatia/c746bf12b9947f436004a0dd9e34f146 to your computer and use it in GitHub Desktop.
Running multiple instances of yarnpkg jobs on CI servers
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
#!/bin/bash | |
# Place this file in your /usr/local/bin and then use darn instead of calling yarn | |
# This will wrap all your yarn calls to go through the same network mutex | |
# Calling yarn as before still works too if needed. | |
# --- Motivation --- | |
# Running multiple build jobs on CI servers like Jenkins will cause contention of | |
# shared yarnpkg resources (cache). This is going to end up badly for builds going | |
# out for deployment. This problem is usually not seen locally because devs rarely build | |
# multiple projects at a time on their local machines. | |
set -ex | |
yarn "$@" --mutex network |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment