From d72bde31249ea95450b645fe2c7a0b09abdbc06b Mon Sep 17 00:00:00 2001 From: Iurii Ignatko Date: Wed, 10 Jan 2024 09:59:44 +0200 Subject: [PATCH] Fix secret reference and add additional renaming --- .github/workflows/integ-test-inject-develocity.yml | 2 +- README.md | 4 ++-- .../gradle-build-action.inject-develocity.init.gradle | 2 +- .../gradle/gradlebuildaction/BaseInitScriptTest.groovy | 6 +++--- .../gradlebuildaction/TestDevelocityInjection.groovy | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/integ-test-inject-develocity.yml b/.github/workflows/integ-test-inject-develocity.yml index 4bb362f4..684a2f0c 100644 --- a/.github/workflows/integ-test-inject-develocity.yml +++ b/.github/workflows/integ-test-inject-develocity.yml @@ -23,7 +23,7 @@ env: DEVELOCITY_URL: https://ge.solutions-team.gradle.com DEVELOCITY_PLUGIN_VERSION: 3.16.1 DEVELOCITY_CCUD_PLUGIN_VERSION: 1.12.1 - DEVELOCITY_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} + DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} jobs: inject-develocity: diff --git a/README.md b/README.md index 53789976..f756dae6 100644 --- a/README.md +++ b/README.md @@ -801,7 +801,7 @@ name: Run build with Develocity injection env: DEVELOCITY_INJECTION_ENABLED: true - DEVELOCITY_URL: https://develocity.gradle.org + DEVELOCITY_URL: https://develocity.your-server.com DEVELOCITY_PLUGIN_VERSION: 3.16.1 DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} # Required to publish scans to develocity.gradle.org @@ -833,7 +833,7 @@ The `init-script` supports a number of additional configuration parameters that | DEVELOCITY_ENFORCE_URL | | enforce the configured Develocity URL over a URL configured in the project's build; set to _true_ to enforce publication of build scans to the configured Develocity URL | | DEVELOCITY_PLUGIN_VERSION | :white_check_mark: | the version of the [Develocity Gradle plugin](https://docs.gradle.com/enterprise/gradle-plugin/) to apply | | DEVELOCITY_CCUD_PLUGIN_VERSION | | the version of the [Common Custom User Data Gradle plugin](https://github.com/gradle/common-custom-user-data-gradle-plugin) to apply, if any | -| DEVELOCITY_PLUGIN_REPOSITORY_URL | | the URL of the repository to use when resolving the Develocity and CCUD plugins; the Gradle Plugin Portal is used by default | +| GRADLE_PLUGIN_REPOSITORY_URL | | the URL of the repository to use when resolving the Develocity and CCUD plugins; the Gradle Plugin Portal is used by default | ## Publishing to scans.gradle.com diff --git a/src/resources/init-scripts/gradle-build-action.inject-develocity.init.gradle b/src/resources/init-scripts/gradle-build-action.inject-develocity.init.gradle index 57e342c3..a393ea72 100644 --- a/src/resources/init-scripts/gradle-build-action.inject-develocity.init.gradle +++ b/src/resources/init-scripts/gradle-build-action.inject-develocity.init.gradle @@ -20,7 +20,7 @@ initscript { return } - def pluginRepositoryUrl = getInputParam('develocity.plugin-repository.url') + def pluginRepositoryUrl = getInputParam('gradle.plugin-repository.url') def gePluginVersion = getInputParam('develocity.plugin.version') def ccudPluginVersion = getInputParam('develocity.ccud-plugin.version') diff --git a/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/BaseInitScriptTest.groovy b/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/BaseInitScriptTest.groovy index fabe25e6..a83bfe98 100644 --- a/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/BaseInitScriptTest.groovy +++ b/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/BaseInitScriptTest.groovy @@ -16,7 +16,7 @@ import java.nio.file.Files import java.util.zip.GZIPOutputStream class BaseInitScriptTest extends Specification { - static final String GE_PLUGIN_VERSION = '3.16.1' + static final String DEVELOCITY_PLUGIN_VERSION = '3.16.1' static final String CCUD_PLUGIN_VERSION = '1.12.1' static final TestGradleVersion GRADLE_3_X = new TestGradleVersion(GradleVersion.version('3.5.1'), 7, 9) @@ -146,7 +146,7 @@ class BaseInitScriptTest extends Specification { } else { """ plugins { - id 'com.gradle.enterprise' version '${GE_PLUGIN_VERSION}' + id 'com.gradle.enterprise' version '${DEVELOCITY_PLUGIN_VERSION}' ${ccudPluginVersion ? "id 'com.gradle.common-custom-user-data-gradle-plugin' version '$ccudPluginVersion'" : ""} } gradleEnterprise { @@ -174,7 +174,7 @@ class BaseInitScriptTest extends Specification { } else if (gradleVersion < GradleVersion.version('6.0')) { """ plugins { - id 'com.gradle.build-scan' version '${GE_PLUGIN_VERSION}' + id 'com.gradle.build-scan' version '${DEVELOCITY_PLUGIN_VERSION}' ${ccudPluginVersion ? "id 'com.gradle.common-custom-user-data-gradle-plugin' version '$ccudPluginVersion'" : ""} } gradleEnterprise { diff --git a/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestDevelocityInjection.groovy b/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestDevelocityInjection.groovy index cc60a87c..854dfc81 100644 --- a/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestDevelocityInjection.groovy +++ b/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestDevelocityInjection.groovy @@ -372,12 +372,12 @@ class TestDevelocityInjection extends BaseInitScriptTest { DEVELOCITY_INJECTION_ENABLED: "true", DEVELOCITY_URL: serverUrl, DEVELOCITY_ALLOW_UNTRUSTED_SERVER: "true", - DEVELOCITY_PLUGIN_VERSION: GE_PLUGIN_VERSION, + DEVELOCITY_PLUGIN_VERSION: DEVELOCITY_PLUGIN_VERSION, DEVELOCITY_BUILD_SCAN_UPLOAD_IN_BACKGROUND: "true" // Need to upload in background since our Mock server doesn't cope with foreground upload ] if (enforceUrl) envVars.put("DEVELOCITY_ENFORCE_URL", "true") if (ccudPluginVersion != null) envVars.put("DEVELOCITY_CCUD_PLUGIN_VERSION", ccudPluginVersion) - if (pluginRepositoryUrl != null) envVars.put("DEVELOCITY_PLUGIN_REPOSITORY_URL", pluginRepositoryUrl) + if (pluginRepositoryUrl != null) envVars.put("GRADLE_PLUGIN_REPOSITORY_URL", pluginRepositoryUrl) return envVars } @@ -387,13 +387,13 @@ class TestDevelocityInjection extends BaseInitScriptTest { "-Ddevelocity.injection-enabled=true", "-Ddevelocity.url=$serverUrl", "-Ddevelocity.allow-untrusted-server=true", - "-Ddevelocity.plugin.version=$GE_PLUGIN_VERSION", + "-Ddevelocity.plugin.version=$DEVELOCITY_PLUGIN_VERSION", "-Ddevelocity.build-scan.upload-in-background=true" ] if (enforceUrl) jvmArgs.add("-Ddevelocity.enforce-url=true") if (ccudPluginVersion != null) jvmArgs.add("-Ddevelocity.ccud-plugin.version=$ccudPluginVersion") - if (pluginRepositoryUrl != null) jvmArgs.add("-Ddevelocity.plugin-repository.url=$pluginRepositoryUrl") + if (pluginRepositoryUrl != null) jvmArgs.add("-Dgradle.plugin-repository.url=$pluginRepositoryUrl") return jvmArgs.collect { it.toString() } // Convert from GStrings }