aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Mandrikov <mandrikov@gmail.com>2019-06-20 20:13:38 +0200
committersonartech <sonartech@sonarsource.com>2019-06-28 08:45:47 +0200
commit9ac5c03a538f33496dd9a84a7c8c2aa62064755c (patch)
tree4c8d6857aa6d3f65bc7ce24159f61a57479ccd74
parent74119245905c25cb123082636f8dc451d80ffa74 (diff)
downloadsonarqube-9ac5c03a538f33496dd9a84a7c8c2aa62064755c.tar.gz
sonarqube-9ac5c03a538f33496dd9a84a7c8c2aa62064755c.zip
Usage of Gradle option "--parallel" should be safe
Gradle should not execute several "yarn install" in parallel, because Yarn doesn't support concurrent access to its global cache.
-rw-r--r--build.gradle9
1 files changed, 9 insertions, 0 deletions
diff --git a/build.gradle b/build.gradle
index 2a9e81430cb..03a5884b8d4 100644
--- a/build.gradle
+++ b/build.gradle
@@ -414,6 +414,15 @@ subprojects {
}
}
+
+// Yarn doesn't support concurrent access to its global cache,
+// i.e. parallel execution of several "yarn install" tasks,
+// since these tasks are independent, we can establish arbitrary total order
+// to prevent their concurrent execution:
+def yarnInstallTasks = allprojects.findResults { it -> it.tasks.findByName('yarn') }
+yarnInstallTasks.eachWithIndex { it, i -> if (i > 0) it.mustRunAfter(yarnInstallTasks.get(i - 1)) }
+
+
artifactory {
clientConfig.setIncludeEnvVars(true)
clientConfig.setEnvVarsExcludePatterns('*password*,*PASSWORD*,*secret*,*MAVEN_CMD_LINE_ARGS*,sun.java.command,*token*,*TOKEN*,*LOGIN*,*login*,*key*,*KEY*')