From f04d354c291e9db25f969ddeffe4066ff58fea6d Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 10 Oct 2023 11:46:20 -0700 Subject: [PATCH 1/3] Attempt to fix download cache on CI See gh-37450 --- ci/scripts/common.sh | 4 ++++ ci/tasks/build-project.yml | 2 +- .../spring-boot-launch-script-tests/build.gradle | 4 ++-- .../spring-boot-loader-tests/build.gradle | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ci/scripts/common.sh b/ci/scripts/common.sh index 0c0f901c50..dee9721c1f 100644 --- a/ci/scripts/common.sh +++ b/ci/scripts/common.sh @@ -1,5 +1,9 @@ source /opt/concourse-java.sh +if [[ -d $PWD/gradle ]]; then + EXPORT GRADLE_USER_HOMR=`pwd`/gradle +fi + setup_symlinks if [[ -d $PWD/embedmongo && ! -d $HOME/.embedmongo ]]; then ln -s "$PWD/embedmongo" "$HOME/.embedmongo" diff --git a/ci/tasks/build-project.yml b/ci/tasks/build-project.yml index 61c86eb759..d672e0ebb1 100644 --- a/ci/tasks/build-project.yml +++ b/ci/tasks/build-project.yml @@ -7,7 +7,7 @@ outputs: - name: git-repo caches: - path: gradle -- path: build/downloads +- path: maven - path: embedmongo params: BRANCH: diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/build.gradle b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/build.gradle index 646c572eca..e76636023f 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/build.gradle +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/build.gradle @@ -43,7 +43,7 @@ task buildApp(type: GradleBuild) { } task downloadJdk(type: Download) { - def destFolder = new File(rootProject.buildDir, "downloads/jdk/bellsoft") + def destFolder = new File(project.gradle.gradleUserHomeDir, "caches/springboot/downloads/jdk/bellsoft") destFolder.mkdirs() src "https://download.bell-sw.com/java/${jdkVersion}/bellsoft-jdk${jdkVersion}-linux-${jdkArch}.tar.gz" dest destFolder @@ -53,7 +53,7 @@ task downloadJdk(type: Download) { task syncJdkDownloads(type: Sync) { dependsOn downloadJdk - from "${rootProject.buildDir}/downloads/jdk/bellsoft/" + from "${project.gradle.gradleUserHomeDir}/caches/springboot/downloads/jdk/bellsoft/" include "bellsoft-jdk${jdkVersion}-linux-${jdkArch}.tar.gz" into "${project.buildDir}/downloads/jdk/bellsoft/" } diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/build.gradle b/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/build.gradle index e287ed0a16..71592ea0aa 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/build.gradle +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/build.gradle @@ -44,7 +44,7 @@ task buildApp(type: GradleBuild) { } task downloadJdk(type: Download) { - def destFolder = new File(rootProject.buildDir, "downloads/jdk/oracle") + def destFolder = new File(project.gradle.gradleUserHomeDir, "caches/springboot/downloads/jdk/oracle") destFolder.mkdirs() src "https://download.oracle.com/java/17/archive/jdk-${oracleJdkVersion}_linux-${oracleJdkArch}_bin.tar.gz" dest destFolder @@ -54,7 +54,7 @@ task downloadJdk(type: Download) { task syncJdkDownloads(type: Sync) { dependsOn downloadJdk - from "${rootProject.buildDir}/downloads/jdk/oracle/" + from "${project.gradle.gradleUserHomeDir}/caches/springboot/downloads/jdk/oracle/" include "jdk-${oracleJdkVersion}_linux-${oracleJdkArch}_bin.tar.gz" into "${project.buildDir}/downloads/jdk/oracle/" } From 9518035e136e67ea7999cbd8618481715e1ef0b1 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 10 Oct 2023 11:56:45 -0700 Subject: [PATCH 2/3] Fix typos See gh-37450 --- ci/scripts/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/scripts/common.sh b/ci/scripts/common.sh index dee9721c1f..d24b0551dc 100644 --- a/ci/scripts/common.sh +++ b/ci/scripts/common.sh @@ -1,7 +1,7 @@ source /opt/concourse-java.sh if [[ -d $PWD/gradle ]]; then - EXPORT GRADLE_USER_HOMR=`pwd`/gradle + export GRADLE_USER_HOME=`pwd`/gradle fi setup_symlinks From fec9804dad83ad58440b0c9326631364a1c4a5f3 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 10 Oct 2023 12:08:44 -0700 Subject: [PATCH 3/3] Don't create .gradle folder early See gh-37450 --- ci/images/setup.sh | 6 ------ ci/scripts/common.sh | 6 ++---- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/ci/images/setup.sh b/ci/images/setup.sh index 7cc0c6744d..c073702de9 100755 --- a/ci/images/setup.sh +++ b/ci/images/setup.sh @@ -51,9 +51,3 @@ curl -L https://github.com/progrium/entrykit/releases/download/v${ENTRYKIT_VERSI chmod +x entrykit && \ mv entrykit /bin/entrykit && \ entrykit --symlink - -########################################################### -# GRADLE ENTERPRISE -########################################################### -mkdir ~/.gradle -echo 'systemProp.user.name=concourse' > ~/.gradle/gradle.properties \ No newline at end of file diff --git a/ci/scripts/common.sh b/ci/scripts/common.sh index d24b0551dc..52fe719787 100644 --- a/ci/scripts/common.sh +++ b/ci/scripts/common.sh @@ -1,12 +1,10 @@ source /opt/concourse-java.sh -if [[ -d $PWD/gradle ]]; then - export GRADLE_USER_HOME=`pwd`/gradle -fi - setup_symlinks if [[ -d $PWD/embedmongo && ! -d $HOME/.embedmongo ]]; then ln -s "$PWD/embedmongo" "$HOME/.embedmongo" fi cleanup_maven_repo "org.springframework.boot" + +echo 'systemProp.user.name=concourse' > ~/.gradle/gradle.properties