diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 02a7184b..874fb2b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,14 +13,14 @@ jobs: name: "build" runs-on: ubuntu-latest env: - TEST_GRADLE_VERSION: 6.7 + TEST_GRADLE_VERSION: 7.6 steps: - uses: actions/checkout@v2 with: fetch-depth: 0 - uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - name: Pull docker images run: 'parallel docker pull -- xenit/alfresco-repository-skeleton:6.0 alfresco/alfresco-content-repository-community:6.0.7-ga tomcat:7-jre8 hello-world alpine:edge' - name: Check @@ -49,18 +49,16 @@ jobs: strategy: matrix: gradle-versions: - - 6.2,6.3,6.4 - - 6.5,6.6,6.7 - - 6.8,6.9,7.0 - - 7.1,7.2,7.3 - - 7.4,7.5,7.6 + - 6.2,6.9 + - 7.0,7.6 + - 8.0,8.9 steps: - uses: actions/checkout@v2 with: fetch-depth: 0 - uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - name: Pull docker images run: 'parallel docker pull -- alfresco/alfresco-content-repository-community:6.0.7-ga tomcat:7-jre8 hello-world alpine:edge' - name: Check diff --git a/CHANGELOG.md b/CHANGELOG.md index fbb36576..deb507f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Alfresco Docker Gradle Plugins - Changelog + +## Version 5.5.0 - 2024-08-06 + +> [!warning] +> This release drops support for Java < 11 +> The docker-compose plugins drop support for Gradle < 7.0 + +### Changed + +* [#342](https://github.com/xenit-eu/alfresco-docker-gradle-plugin/pull/342) - Support docker compose v2 + + ## Version 5.4.0 - 2023-02-02 ### Dependencies diff --git a/UPGRADING-5.5.md b/UPGRADING-5.5.md new file mode 100644 index 00000000..31a0449f --- /dev/null +++ b/UPGRADING-5.5.md @@ -0,0 +1,10 @@ +# Upgrade guide: 5.4 -> 5.5 + +This version uses docker compose v2 by default. If you still want to keeping using docker-compose v1 instead, put: + +```groovy +dockerCompose { + useDockerComposeV2 = false +} +``` + \ No newline at end of file diff --git a/build.gradle b/build.gradle index 5e731f0b..056e6b82 100644 --- a/build.gradle +++ b/build.gradle @@ -15,7 +15,11 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocatio group 'eu.xenit.gradle' -sourceCompatibility = 1.8 +java { + toolchain { + languageVersion = JavaLanguageVersion.of(11) + } +} configurations { packaged @@ -132,7 +136,7 @@ dependencies { } implementation 'com.bmuschko:gradle-docker-plugin:9.3.1' - implementation 'com.avast.gradle:gradle-docker-compose-plugin:0.16.12' + implementation 'com.avast.gradle:gradle-docker-compose-plugin:0.17.7' testImplementation group: 'junit', name: 'junit', version: '4.13.2' testImplementation 'org.hamcrest:hamcrest-core:2.2' testImplementation gradleTestKit() diff --git a/src/integrationTest/java/eu/xenit/gradle/testrunner/AbstractIntegrationTest.java b/src/integrationTest/java/eu/xenit/gradle/testrunner/AbstractIntegrationTest.java index e3c88052..505e21b7 100644 --- a/src/integrationTest/java/eu/xenit/gradle/testrunner/AbstractIntegrationTest.java +++ b/src/integrationTest/java/eu/xenit/gradle/testrunner/AbstractIntegrationTest.java @@ -7,13 +7,10 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; -import java.util.HashSet; import java.util.LinkedHashSet; -import java.util.List; import java.util.Set; import org.apache.commons.io.FileUtils; import org.gradle.testkit.runner.BuildResult; @@ -44,20 +41,11 @@ public static Collection testData() { }); } return Arrays.asList(new Object[][]{ - {"7.6"}, - {"7.5.1"}, - {"7.4.2"}, - {"7.3.3"}, - {"7.2"}, - {"7.1.1"}, + {"8.9"}, + {"8.0.1"}, + {"7.6.4"}, {"7.0.2"}, {"6.9.3"}, - {"6.8.3"}, - {"6.7.1"}, - {"6.6.1"}, - {"6.5.1"}, - {"6.4.1"}, - {"6.3"}, {"6.2.2"}, }); } diff --git a/src/integrationTest/java/eu/xenit/gradle/testrunner/ExampleRunner.java b/src/integrationTest/java/eu/xenit/gradle/testrunner/ExampleRunner.java index 3bfe3c37..293a4d2e 100644 --- a/src/integrationTest/java/eu/xenit/gradle/testrunner/ExampleRunner.java +++ b/src/integrationTest/java/eu/xenit/gradle/testrunner/ExampleRunner.java @@ -1,8 +1,10 @@ package eu.xenit.gradle.testrunner; +import static org.junit.Assume.assumeThat; import static org.junit.Assume.assumeTrue; import org.gradle.util.GradleVersion; +import org.hamcrest.Matchers; import org.junit.Test; import java.io.IOException; @@ -43,26 +45,31 @@ public void testApplyAmpsExample() throws IOException { @Test public void testExampleDockerPlugin() throws IOException { + assumeThat("The docker-compose plugin requires Gradle 7", GradleVersion.version(gradleVersion), Matchers.greaterThanOrEqualTo(GradleVersion.version("7.0"))); testProjectFolder(EXAMPLES.resolve("example-docker-plugin")); } @Test public void testExampleDockerPluginLegacy() throws IOException { + assumeThat("The docker-compose plugin requires Gradle 7", GradleVersion.version(gradleVersion), Matchers.greaterThanOrEqualTo(GradleVersion.version("7.0"))); testProjectFolder(EXAMPLES.resolve("example-docker-plugin-legacy")); } @Test public void testComposeUp() throws IOException { + assumeThat("The docker-compose plugin requires Gradle 7", GradleVersion.version(gradleVersion), Matchers.greaterThanOrEqualTo(GradleVersion.version("7.0"))); testProjectFolder(EXAMPLES.resolve("example-docker-plugin"), ":integrationTest"); } @Test public void testDockerComposeAutoExample() throws IOException { + assumeThat("The docker-compose plugin requires Gradle 7", GradleVersion.version(gradleVersion), Matchers.greaterThanOrEqualTo(GradleVersion.version("7.0"))); testProjectFolder(EXAMPLES.resolve("docker-compose-auto-example"), ":integrationTest"); } @Test public void testDockerComposeExample() throws IOException { + assumeThat("The docker-compose plugin requires Gradle 7", GradleVersion.version(gradleVersion), Matchers.greaterThanOrEqualTo(GradleVersion.version("7.0"))); testProjectFolder(EXAMPLES.resolve("docker-compose-example"), ":integrationTest"); } diff --git a/src/integrationTest/java/eu/xenit/gradle/testrunner/Reproductions.java b/src/integrationTest/java/eu/xenit/gradle/testrunner/Reproductions.java index 7987f960..20a1478e 100644 --- a/src/integrationTest/java/eu/xenit/gradle/testrunner/Reproductions.java +++ b/src/integrationTest/java/eu/xenit/gradle/testrunner/Reproductions.java @@ -3,6 +3,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; +import static org.junit.Assume.assumeThat; import eu.xenit.gradle.docker.alfresco.tasks.extension.internal.DockerfileWithWarsExtensionImpl; import java.io.IOException; @@ -12,6 +13,8 @@ import org.gradle.testkit.runner.BuildResult; import org.gradle.testkit.runner.BuildTask; import org.gradle.testkit.runner.TaskOutcome; +import org.gradle.util.GradleVersion; +import org.hamcrest.Matchers; import org.junit.Ignore; import org.junit.Test; @@ -81,6 +84,7 @@ public void testDockerAlfrescoPluginWithoutConfiguration() throws IOException { @Test public void testAlfrescoAmpDependencyOrder() throws IOException { + assumeThat("The amp plugin requires Gradle 7.1", GradleVersion.version(gradleVersion), Matchers.greaterThanOrEqualTo(GradleVersion.version("7.1"))); testProjectFolder(REPRODUCTIONS.resolve("alfresco-amp-dependency-order"), ":applyAlfrescoAmp"); } @@ -103,6 +107,7 @@ public void testIssue97() throws IOException { @Test public void testIssue96() throws IOException { + assumeThat("The docker-compose plugin requires Gradle 7", GradleVersion.version(gradleVersion), Matchers.greaterThanOrEqualTo(GradleVersion.version("7.0"))); final String folder = "issue-96"; final String task = ":buildDockerImage"; @@ -116,6 +121,7 @@ public void testIssue96() throws IOException { @Test public void testIssue104() throws IOException { + assumeThat("The docker-compose plugin requires Gradle 7", GradleVersion.version(gradleVersion), Matchers.greaterThanOrEqualTo(GradleVersion.version("7.0"))); final String folder = "issue-104"; final String task = ":functionalTest"; @@ -133,6 +139,7 @@ public void testIssue107() throws IOException { @Test public void testIssue50() throws IOException { + assumeThat("The amp plugin requires Gradle 7.1", GradleVersion.version(gradleVersion), Matchers.greaterThanOrEqualTo(GradleVersion.version("7.1"))); testProjectFolder(REPRODUCTIONS.resolve("issue-50"), ":alfrescoWar"); } diff --git a/src/integrationTest/reproductions/alfresco-amp-dependency-order/build.gradle b/src/integrationTest/reproductions/alfresco-amp-dependency-order/build.gradle index 2c50af4f..51f7b357 100644 --- a/src/integrationTest/reproductions/alfresco-amp-dependency-order/build.gradle +++ b/src/integrationTest/reproductions/alfresco-amp-dependency-order/build.gradle @@ -1,6 +1,6 @@ plugins { - id "eu.xenit.amp" version "1.0.1" - id "eu.xenit.alfresco" version "1.0.1" + id "eu.xenit.amp" version "1.2.0" + id "eu.xenit.alfresco" version "1.2.0" id "eu.xenit.docker-alfresco" } diff --git a/src/integrationTest/reproductions/issue-50/build.gradle b/src/integrationTest/reproductions/issue-50/build.gradle index bc155fb1..c9643b70 100644 --- a/src/integrationTest/reproductions/issue-50/build.gradle +++ b/src/integrationTest/reproductions/issue-50/build.gradle @@ -1,6 +1,6 @@ plugins { - id "eu.xenit.amp" version "1.0.1" - id "eu.xenit.alfresco" version "1.0.1" + id "eu.xenit.amp" version "1.2.0" + id "eu.xenit.alfresco" version "1.2.0" id "eu.xenit.docker-alfresco" } diff --git a/src/main/java/eu/xenit/gradle/docker/compose/DockerComposeExtensionOverride.java b/src/main/java/eu/xenit/gradle/docker/compose/DockerComposeExtensionOverride.java index 9187fd6b..17faceef 100644 --- a/src/main/java/eu/xenit/gradle/docker/compose/DockerComposeExtensionOverride.java +++ b/src/main/java/eu/xenit/gradle/docker/compose/DockerComposeExtensionOverride.java @@ -78,8 +78,9 @@ protected ComposeSettings cloneAsNested(String name) { r.setProjectNamePrefix(this.getProjectNamePrefix()); r.getExecutable().set(this.getExecutable().get()); + r.getUseDockerComposeV2().set(this.getUseDockerComposeV2().get()); r.getDockerExecutable().set(this.getDockerExecutable().get()); - r.getEnvironment().set(new HashMap(this.getEnvironment().get())); + r.getEnvironment().set(new HashMap<>(this.getEnvironment().get())); r.getDockerComposeWorkingDirectory().set(this.getDockerComposeWorkingDirectory().getOrNull()); r.getDockerComposeStopTimeout().set(this.getDockerComposeStopTimeout().get()); diff --git a/src/main/java/eu/xenit/gradle/docker/compose/DockerComposePlugin.java b/src/main/java/eu/xenit/gradle/docker/compose/DockerComposePlugin.java index 2a2395f0..d76b9ae0 100644 --- a/src/main/java/eu/xenit/gradle/docker/compose/DockerComposePlugin.java +++ b/src/main/java/eu/xenit/gradle/docker/compose/DockerComposePlugin.java @@ -2,6 +2,7 @@ import com.avast.gradle.dockercompose.ComposeSettings; import eu.xenit.gradle.docker.config.DockerConfigPlugin; +import eu.xenit.gradle.docker.internal.GradleVersionRequirement; import org.gradle.api.Plugin; import org.gradle.api.Project; @@ -13,6 +14,7 @@ public class DockerComposePlugin implements Plugin { @Override public void apply(Project project) { + GradleVersionRequirement.atLeast("7.0", String.format("use the %s plugin", PLUGIN_ID)); dockerComposeConvention = project.getExtensions() .create("dockerCompose", DockerComposeExtensionOverride.class, project); project.getPluginManager().apply(DockerConfigPlugin.class);