Add script to cache dependencies (#33726)
With the introduction of immutable workers into our CI, we now have a problem where we would have to download dependencies on every single build. To this end our infrastructure team has introduced the possibility to download dependencies one time and then bake these into the base immutable worker image. For this, we introduce our version of this special script which runs a task that downloads all dependencies of all configurations. With this script, our infrastructure team will be rebuilding these images on an at-least daily basis. This helps us avoid having to download the dependencies for every single build.
This commit is contained in:
parent
9706584836
commit
92a48fa6b8
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
SCRIPT="$0"
|
||||
|
||||
# SCRIPT might be an arbitrarily deep series of symbolic links; loop until we
|
||||
# have the concrete path
|
||||
while [ -h "$SCRIPT" ] ; do
|
||||
ls=$(ls -ld "$SCRIPT")
|
||||
# Drop everything prior to ->
|
||||
link=$(expr "$ls" : '.*-> \(.*\)$')
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
SCRIPT="$link"
|
||||
else
|
||||
SCRIPT=$(dirname "$SCRIPT")/"$link"
|
||||
fi
|
||||
done
|
||||
|
||||
source $(dirname "${SCRIPT}")/java-versions.properties
|
||||
JAVA_HOME="${HOME}"/.java/${ES_BUILD_JAVA} ./gradlew resolveAllDependencies --parallel
|
|
@ -628,3 +628,11 @@ if (System.properties.get("build.compare") != null) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
task resolveAllDependencies {
|
||||
doLast {
|
||||
configurations.findAll { it.isCanBeResolved() }.each { it.resolve() }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue