diff --git a/.github/actions/prepare-docker/action.yaml b/.github/actions/prepare-docker/action.yaml new file mode 100644 index 0000000..422215c --- /dev/null +++ b/.github/actions/prepare-docker/action.yaml @@ -0,0 +1,19 @@ +name: Preparations for later docker usage +description: prepares the access to docker.io and builds an image using createimage.sh +inputs: + docker-user: + required: true + description: The user to be used for the docker login + docker-password: + required: true + description: The password to be used for the docker login + +runs: + using: composite + steps: + - name: Run docker login + shell: bash + run: echo ${{ inputs.docker-password }} | docker login -u ${{ inputs.docker-user }} --password-stdin + - name: Create Test container + shell: bash + run: cd testdocker && ./createimage.sh && cd .. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0e22663..1612850 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,64 +1,30 @@ # This workflow will build a Java project with Gradle # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle + name: Run build and tests on: push: branches: - - '*' + - '**' pull_request: branches: [ master ] jobs: build: + permissions: + checks: write + pull-requests: write + contents: read environment: CIRelease runs-on: ubuntu-latest - steps: - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: 11 - distribution: temurin - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - run: git fetch --all --tags - - name: Run docker login - run: echo ${{ secrets.DOCKERPASSWD }} | docker login -u ${{ secrets.DOCKERUSER }} --password-stdin - - name: Create Test container - run: cd testdocker && ./createimage.sh && cd .. - - name: Create .gradle dir - run: mkdir -p $HOME/.gradle - - name: Install gpg secret key - env: - SIGNINGFILE: ${{ secrets.SIGNINGFILE }} - run: | - cat <(echo -e "${{ secrets.SIGNINGFILE }}") | gpg --batch --import - gpg --list-secret-keys --keyid-format LONG - - name: Export gpg file - env: - SIGNINGKEYID: ${{ secrets.SIGNINGKEYID }} - SIGNINGPASSWORD: ${{ secrets.SIGNINGPASSWORD }} - run: | - gpg --batch --passphrase="$SIGNINGPASSWORD" --pinentry-mode loopback --export-secret-keys $SIGNINGKEYID > $HOME/.gradle/secrets.gpg - - name: Create gradle sproperties - env: - APIKEY: ${{ secrets.APIKEY }} - APISECRET: ${{ secrets.APISECRET }} - SIGNINGKEYID: ${{ secrets.SIGNINGKEYID }} - SIGNINGPASSWORD: ${{ secrets.SIGNINGPASSWORD }} - SONATYPEPASSWORD: ${{ secrets.SONATYPEPASSWORD }} - SONATYPEUSER: ${{ secrets.SONATYPEUSER }} - run: echo -e "gradle.publish.key=$APIKEY\ngradle.publish.secret=$APISECRET\nsigning.keyId=$SIGNINGKEYID\nsigning.password=$SIGNINGPASSWORD\nsigning.secretKeyRingFile=$HOME/.gradle/secrets.gpg\nsonatypeUsername=$SONATYPEUSER\nsonatypePassword=$SONATYPEPASSWORD" > $HOME/.gradle/gradle.properties - - name: Build and test with Gradle - env: - GRADLE_OPTS: "-Dorg.gradle.daemon=true" - run: ./gradlew test build :publishIntershopMvnPublicationToMavenRepository -s --scan - - name: Publish Unit Test Results - uses: EnricoMi/publish-unit-test-result-action/composite@v2 - if: always() + - name: Setup + uses: IntershopCommunicationsAG/.github/actions/gradle-plugin-setup@v1.0 + - name: Prepare Docker + uses: ./.github/actions/prepare-docker with: - files: build/test-results/**/*.xml - - name: Post Build - run: rm -f $HOME/.gradle/gradle.properties && rm -f $HOME/.docker/config.json + docker-user: ${{ secrets.DOCKERUSER }} + docker-password: ${{ secrets.DOCKERPASSWD }} + - name: Build + uses: IntershopCommunicationsAG/.github/actions/gradle-plugin-build@v1.0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ca14fae..61a317d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,59 +1,36 @@ # This workflow will build a Java project with Gradle # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle + name: Run release build from tag on: push: tags: - - '*' + - '**' jobs: - release: + build: + permissions: + checks: write + pull-requests: write + contents: read environment: CIRelease runs-on: ubuntu-latest - steps: - - name: Set up JDK 11 - uses: actions/setup-java@v3 + - name: Setup + uses: IntershopCommunicationsAG/.github/actions/gradle-plugin-setup@v1.0 + - name: Prepare Docker + uses: ./.github/actions/prepare-docker with: - java-version: 11 - distribution: temurin - - uses: actions/checkout@v2 + docker-user: ${{ secrets.DOCKERUSER }} + docker-password: ${{ secrets.DOCKERPASSWD }} + - name: Release + uses: IntershopCommunicationsAG/.github/actions/gradle-plugin-release@v1.0 with: - fetch-depth: 0 - - run: git fetch --all --tag - - name: Create .gradle dir - run: mkdir -p $HOME/.gradle - - id: install-secret-key - name: Install gpg secret key - env: - SIGNINGFILE: ${{ secrets.SIGNINGFILE }} - run: | - cat <(echo -e "${{ secrets.SIGNINGFILE }}") | gpg --batch --import - gpg --list-secret-keys --keyid-format LONG - - id: export-gpg-file - name: Export gpg file - env: - SIGNINGKEYID: ${{ secrets.SIGNINGKEYID }} - SIGNINGPASSWORD: ${{ secrets.SIGNINGPASSWORD }} - run: | - gpg --batch --passphrase="$SIGNINGPASSWORD" --pinentry-mode loopback --export-secret-keys $SIGNINGKEYID > $HOME/.gradle/secrets.gpg - - name: Create gradle sproperties - env: - APIKEY: ${{ secrets.APIKEY }} - APISECRET: ${{ secrets.APISECRET }} - SIGNINGKEYID: ${{ secrets.SIGNINGKEYID }} - SIGNINGPASSWORD: ${{ secrets.SIGNINGPASSWORD }} - SONATYPEPASSWORD: ${{ secrets.SONATYPEPASSWORD }} - SONATYPEUSER: ${{ secrets.SONATYPEUSER }} - run: echo -e "gradle.publish.key=$APIKEY\ngradle.publish.secret=$APISECRET\nsigning.keyId=$SIGNINGKEYID\nsigning.password=$SIGNINGPASSWORD\nsigning.secretKeyRingFile=$HOME/.gradle/secrets.gpg\nsonatypeUsername=$SONATYPEUSER\nsonatypePassword=$SONATYPEPASSWORD" > $HOME/.gradle/gradle.properties - - name: Run docker login - run: echo ${{ secrets.DOCKERPASSWD }} | docker login -u ${{ secrets.DOCKERUSER }} --password-stdin - - name: Create Test container - run: cd testdocker && ./createimage.sh && cd .. - - name: Run gradle release - env: - GRADLE_OPTS: "-Dorg.gradle.daemon=true" - run: ./gradlew -PrunOnCI=true test build :publishIntershopMvnPublicationToMavenRepository :publishPlugins -s --scan - - name: Post Build - run: rm -f $HOME/.gradle/gradle.properties && rm -f $HOME/.docker/config.json + signing-file: ${{ secrets.SIGNINGFILE }} + signing-key-id: ${{ secrets.SIGNINGKEYID }} + signing-password: ${{ secrets.SIGNINGPASSWORD }} + api-key: ${{ secrets.APIKEY }} + api-secret: ${{ secrets.APISECRET }} + sonatype-user: ${{ secrets.SONATYPEUSER }} + sonatype-password: ${{ secrets.SONATYPEPASSWORD }} diff --git a/README-signing.asciidoc b/README-signing.asciidoc index ac4db63..2768648 100644 --- a/README-signing.asciidoc +++ b/README-signing.asciidoc @@ -14,11 +14,17 @@ gpg --quick-generate-key --batch --pinentry-mode loopback --passphrase=` | `redis:latest` | This image is used for a local redis instance, which can be used as a pagecache when the WebAdapter is disabled. |=== -===== Image Build Configuration `ProjectConfiguration`[[ProjectConfiguration]] +[[ProjectConfiguration]]===== Image Build Configuration `ProjectConfiguration` *Properties* @@ -669,9 +671,10 @@ Furthermore it depends on the configuration of Geb self (`GebConfig.groovy`). ++++ .build.gradle [source,groovy] +[subs=+attributes] ---- plugins { - id 'com.intershop.gradle.icm.docker.gebtest' version '3.4.0' + id 'com.intershop.gradle.icm.docker.gebtest' version '{latestRevision}' } gebConfiguration { @@ -727,9 +730,10 @@ gebConfiguration { ++++ .build.gradle.kts [source,kotlin] +[subs=+attributes] ---- plugins { - id("com.intershop.gradle.icm.docker.gebtest") version "3.4.0" + id("com.intershop.gradle.icm.docker.gebtest") version "{latestRevision}" } extensions.getByType(GebConfiguration::class.java).apply { @@ -788,6 +792,7 @@ The plugin is based on the following GebTest configuration: .resources/GebConfig.groovy [source,groovy] +[subs=+attributes] ---- import org.junit.runner.Description import org.junit.runners.model.Statement @@ -1044,6 +1049,7 @@ This is a minimum set of properties. icm.properties [source, properties] +[subs=+attributes] ---- # database connection configuration intershop.databaseType = oracle|mssql diff --git a/build.gradle.kts b/build.gradle.kts index f241bcb..f135682 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,4 @@ import org.asciidoctor.gradle.jvm.AsciidoctorTask -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile /* * Copyright 2020 Intershop Communications AG. @@ -38,9 +37,6 @@ plugins { // artifact signing - necessary on Maven Central signing - // intershop version plugin - id("com.intershop.gradle.scmversion") version "6.2.0" - // plugin for documentation id("org.asciidoctor.jvm.convert") version "3.3.2" @@ -51,13 +47,11 @@ plugins { id("com.gradle.plugin-publish") version "1.2.1" } -scm { - version.initialVersion = "1.0.0" -} - group = "com.intershop.gradle.icm.docker" description = "Intershop Commerce Management Plugins for Docker Integration" -version = scm.version.version +// apply gradle property 'projectVersion' to project.version, default to 'LOCAL' +val projectVersion : String? by project +version = projectVersion ?: "LOCAL" val sonatypeUsername: String? by project val sonatypePassword: String? by project @@ -68,11 +62,11 @@ repositories { gradlePluginPortal() } +val pluginUrl = "https://github.com/IntershopCommunicationsAG/${project.name}" +val pluginTags = listOf("intershop", "build", "icm", "docker") gradlePlugin { - val pluginURL = "https://github.com/IntershopCommunicationsAG/${project.name}" - val pluginTags = listOf("intershop", "build", "icm", "docker") - website = pluginURL - vcsUrl = pluginURL + website = pluginUrl + vcsUrl = pluginUrl plugins { create("icmDockerPlugin") { @@ -120,42 +114,44 @@ gradlePlugin { } } java { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 + withJavadocJar() + withSourcesJar() + toolchain { + languageVersion = JavaLanguageVersion.of(17) + } } // set correct project status if (project.version.toString().endsWith("-SNAPSHOT")) { - status = "snapshot'" + status = "snapshot" } -val shaded by configurations.creating -val compileOnly = configurations.getByName("compileOnly") -compileOnly.extendsFrom(shaded) -val buildDir = project.layout.buildDirectory.asFile.get() - -tasks { - withType().configureEach { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_11.toString() +testing { + suites.withType { + useSpock() + dependencies { + implementation("com.intershop.gradle.test:test-gradle-plugin:5.0.1") + implementation(gradleTestKit()) } - } - - withType().configureEach { - systemProperty("intershop.gradle.versions", "8.4") - testLogging { - showStandardStreams = true + targets { + all { + testTask.configure { + systemProperty("intershop.gradle.versions", "8.5") + testLogging { + showStandardStreams = true + } + } + } } - useJUnitPlatform() - - dependsOn("jar") } +} - register("copyAsciiDoc") { +tasks { + val copyAsciiDocTask = register("copyAsciiDoc") { includeEmptyDirs = false - val outputDir = file("$buildDir/tmp/asciidoctorSrc") + val outputDir = project.layout.buildDirectory.dir("tmp/asciidoctorSrc") val inputFiles = fileTree(rootDir) { include("**/*.asciidoc") exclude("build/**") @@ -165,7 +161,7 @@ tasks { outputs.dir( outputDir ) doFirst { - outputDir.mkdir() + outputDir.get().asFile.mkdir() } from(inputFiles) @@ -173,19 +169,24 @@ tasks { } withType { - dependsOn("copyAsciiDoc") - - setSourceDir(file("$buildDir/tmp/asciidoctorSrc")) - sources(delegateClosureOf { - include("README.asciidoc") + dependsOn(copyAsciiDocTask) + sourceDirProperty.set(project.provider{ + val dir = project.objects.directoryProperty() + dir.set(copyAsciiDocTask.get().outputs.files.first()) + dir.get() }) + sources { + include("README.asciidoc") + } outputOptions { setBackends(listOf("html5", "docbook")) } - options = mapOf( "doctype" to "article", - "ruby" to "erubis") + options = mapOf( + "doctype" to "article", + "ruby" to "erubis" + ) attributes = mapOf( "latestRevision" to project.version, "toc" to "left", @@ -195,7 +196,8 @@ tasks { "setanchors" to "true", "idprefix" to "asciidoc", "idseparator" to "-", - "docinfo1" to "true") + "docinfo1" to "true" + ) } withType { @@ -203,17 +205,19 @@ tasks { xml.required.set(true) html.required.set(true) - html.outputLocation.set( File(project.layout.buildDirectory.asFile.get(), "jacocoHtml")) + html.outputLocation.set( project.layout.buildDirectory.dir("jacocoHtml")) } val jacocoTestReport by tasks - jacocoTestReport.dependsOn("test") + jacocoTestReport.dependsOn(test) } - getByName("jar").dependsOn("asciidoctor") + jar.configure { + dependsOn(asciidoctor) + } dokkaJavadoc.configure { - outputDirectory.set(buildDir.resolve("dokka")) + outputDirectory.set(project.layout.buildDirectory.dir("dokka")) } withType { @@ -227,7 +231,7 @@ tasks { } afterEvaluate { - getByName("javadocJar") { + named("javadocJar") { dependsOn(dokkaJavadoc) from(dokkaJavadoc) } @@ -239,18 +243,18 @@ publishing { create("intershopMvn", MavenPublication::class.java) { from(components["java"]) - artifact(File(buildDir, "docs/asciidoc/html5/README.html")) { + artifact(project.layout.buildDirectory.file("docs/asciidoc/html5/README.html")) { classifier = "reference" } - artifact(File(buildDir, "docs/asciidoc/docbook/README.xml")) { + artifact(project.layout.buildDirectory.file("docs/asciidoc/docbook/README.xml")) { classifier = "docbook" } pom { name.set(project.name) description.set(project.description) - url.set("https://github.com/IntershopCommunicationsAG/${project.name}") + url.set(pluginUrl) licenses { license { name.set("The Apache License, Version 2.0") @@ -272,7 +276,7 @@ publishing { scm { connection.set("git@github.com:IntershopCommunicationsAG/${project.name}.git") developerConnection.set("git@github.com:IntershopCommunicationsAG/${project.name}.git") - url.set("https://github.com/IntershopCommunicationsAG/${project.name}") + url.set(pluginUrl) } } } @@ -296,16 +300,11 @@ signing { dependencies { implementation(gradleApi()) - implementation(localGroovy()) - implementation(gradleKotlinDsl()) implementation("org.apache.solr:solr-solrj:9.4.0") implementation("com.bmuschko:gradle-docker-plugin:8.1.0") - implementation("com.intershop.gradle.icm:icm-gradle-plugin:5.8.0") + implementation("com.intershop.gradle.icm:icm-gradle-plugin:6.0.0") implementation("com.intershop.gradle.jobrunner:icmjobrunner:1.0.5") - - testImplementation("com.intershop.gradle.test:test-gradle-plugin:4.1.2") - testImplementation(gradleTestKit()) } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7f93135..d64cd49 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3fa8f86..1af9e09 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew.bat b/gradlew.bat index 93e3f59..6689b85 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,92 +1,92 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/settings.gradle.kts b/settings.gradle.kts index 0e5fa19..a24659a 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("com.gradle.enterprise").version("3.0") + id("com.gradle.enterprise").version("3.16.1") } gradleEnterprise { @@ -10,4 +10,3 @@ gradleEnterprise { } rootProject.name = "icm-docker-plugin" - diff --git a/src/main/kotlin/com/intershop/gradle/icm/docker/tasks/geb/GebTest.kt b/src/main/kotlin/com/intershop/gradle/icm/docker/tasks/geb/GebTest.kt index 250116a..5d9cadd 100644 --- a/src/main/kotlin/com/intershop/gradle/icm/docker/tasks/geb/GebTest.kt +++ b/src/main/kotlin/com/intershop/gradle/icm/docker/tasks/geb/GebTest.kt @@ -62,8 +62,7 @@ abstract class GebTest : Test() { } systemProperty("geb.env", gebEnvironment.get()) - val buildDir = project.layout.buildDirectory.asFile.get() - systemProperty("geb.build.reportsDir", "$buildDir/geb-reports/${gebEnvironment.get()}") + systemProperty("geb.build.reportsDir", project.layout.buildDirectory.dir("geb-reports/${gebEnvironment.get()}")) useJUnitPlatform() diff --git a/src/test/groovy/com/intershop/gradle/icm/docker/ICMDockerPluginIntegegrationSpec.groovy b/src/test/groovy/com/intershop/gradle/icm/docker/ICMDockerPluginIntegegrationSpec.groovy index 566440b..451cc88 100644 --- a/src/test/groovy/com/intershop/gradle/icm/docker/ICMDockerPluginIntegegrationSpec.groovy +++ b/src/test/groovy/com/intershop/gradle/icm/docker/ICMDockerPluginIntegegrationSpec.groovy @@ -231,48 +231,6 @@ class ICMDockerPluginIntegegrationSpec extends AbstractIntegrationGroovySpec { testImage.set("intershopmock/icm-as-mock:mock") } } - - serverDirConfig { - base { - dirs { - main { - dir.set(file("config/base")) - exclude("**/cluster/test.properties") - } - } - exclude("**/cluster/cartridgelist.properties") - } - prod { - - dirs { - main { - dir.set(file("config/prod")) - } - } - } - test { - - dirs { - main { - dir.set(file("config/test")) - } - } - - } - dev { - - dirs { - main { - dir.set(file("config/dev")) - } - test { - dir.set(file("config/test")) - exclude("**/cluster/test.properties") - } - } - - } - } } } @@ -462,43 +420,6 @@ class ICMDockerPluginIntegegrationSpec extends AbstractIntegrationGroovySpec { dependency.set("com.intershop.payment:paymenttest:1.0.0") } } - - serverDirConfig { - base { - dirs { - main { - dir.set(file("config/base")) - exclude("**/cluster/test.properties") - } - } - exclude("**/cluster/cartridgelist.properties") - } - prod { - dirs { - main { - dir.set(file("config/prod")) - } - } - } - test { - dirs { - main { - dir.set(file("config/test")) - } - } - } - dev { - dirs { - main { - dir.set(file("config/dev")) - } - test { - dir.set(file("config/test")) - exclude("**/cluster/test.properties") - } - } - } - } } } @@ -649,48 +570,6 @@ class ICMDockerPluginIntegegrationSpec extends AbstractIntegrationGroovySpec { image.set("intershophub/icm-as:11.0.1") } } - - serverDirConfig { - base { - dirs { - main { - dir.set(file("config/base")) - exclude("**/cluster/test.properties") - } - } - exclude("**/cluster/cartridgelist.properties") - } - prod { - - dirs { - main { - dir.set(file("config/prod")) - } - } - } - test { - - dirs { - main { - dir.set(file("config/test")) - } - } - - } - dev { - - dirs { - main { - dir.set(file("config/dev")) - } - test { - dir.set(file("config/test")) - exclude("**/cluster/test.properties") - } - } - - } - } } } diff --git a/testdocker/Dockerfile b/testdocker/Dockerfile index 37a433a..dd7cad4 100644 --- a/testdocker/Dockerfile +++ b/testdocker/Dockerfile @@ -32,7 +32,7 @@ RUN mkdir -p /intershop-prj/jgroups-share && \ chown -R ${USERNAME}:intershop /intershop-init # FROM busybox:latest -FROM eclipse-temurin:11.0.14.1_1-jre +FROM eclipse-temurin:17.0.9_9-jre ARG USERNAME=intershop ARG USERID=150 @@ -41,7 +41,7 @@ RUN chmod a+x -R /usr/bin/dirdiff RUN addgroup --gid 150 intershop && \ useradd -m --uid ${USERID} -g intershop --shell /bin/sh ${USERNAME} && \ - useradd --uid 151 -g intershop --shell /bin/sh intershop + useradd --uid 151 -g intershop --shell /bin/sh intershop2 COPY --from=BUILD /intershop-prj/ /intershop/ COPY --from=BUILD /intershop-init/ /intershop-init/ diff --git a/testdocker/createimage.cmd b/testdocker/createimage.cmd new file mode 100644 index 0000000..0d75e7d --- /dev/null +++ b/testdocker/createimage.cmd @@ -0,0 +1,10 @@ +rem this file is not actually used by the build but supports developers to execute the tests locally + +echo Building base image intershopmock/icm-as-mock:mock + +USER=intershop +USERID=150 + +echo Build for user $USER and id $USERID + +docker build --build-arg USERNAME=$USER --build-arg USERID=$USERID -t intershopmock/icm-as-mock:mock . -f .\Dockerfile