Skip to content

Instantly share code, notes, and snippets.

@narkisr
Created October 25, 2011 16:59
Show Gist options
  • Save narkisr/1313490 to your computer and use it in GitHub Desktop.
Save narkisr/1313490 to your computer and use it in GitHub Desktop.
Ugly solution for gradles cache access issue in multi build enviroment (jenkins)
GRADLE_APP_BASE_NAME=`basename "$0"`
STARTER_MAIN_CLASS=org.gradle.launcher.GradleMain
# my ugly extension point
CACHE_HOME=/var/lib/jenkins/caches/$JOB_NAME
mkdir -p $CACHE_HOME
cp /var/lib/jenkins/.gradle/init.gradle $CACHE_HOME
exec "$JAVACMD" $JAVA_OPTS $GRADLE_OPTS \
-classpath "$CLASSPATH" \
-Dorg.gradle.appname="$GRADLE_APP_BASE_NAME" \
$STARTER_MAIN_CLASS \
"$@" -g $CACHE_HOME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment