From 935ff1ae14578d0865109aa021f7c2c2e0ba775b Mon Sep 17 00:00:00 2001 From: Arun Venmany Date: Tue, 12 Nov 2024 15:47:45 +0530 Subject: [PATCH 1/2] Varprocessing branch changes Signed-off-by: Arun Venmany --- .github/workflows/gradle.yml | 5 +++-- build.gradle | 2 +- .../tools/gradle/tasks/AbstractServerTask.groovy | 10 ++++------ .../tools/gradle/tasks/DeployTask.groovy | 3 +-- .../tools/gradle/tasks/StartTask.groovy | 15 ++++----------- .../tools/gradle/tasks/UndeployTask.groovy | 3 +-- 6 files changed, 14 insertions(+), 24 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index f5797de1..b09a4de1 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -39,8 +39,9 @@ jobs: - name: Checkout ci.common uses: actions/checkout@v3 with: - repository: OpenLiberty/ci.common + repository: arunvenmany-ibm/ci.common path: ci.common + ref: varProcessing - name: Checkout ci.ant uses: actions/checkout@v3 with: @@ -124,7 +125,7 @@ jobs: - name: Clone ci.ant, ci.common, ci.gradle repos to C drive run: | cp -r D:/a/ci.gradle/ci.gradle C:/ci.gradle - git clone https://github.com/OpenLiberty/ci.common.git C:/ci.common + git clone https://github.com/arunvenmany-ibm/ci.common.git --branch varProcessing --single-branch C:/ci.common git clone https://github.com/OpenLiberty/ci.ant.git C:/ci.ant # Cache mvn/gradle packages - name: Cache Maven packages diff --git a/build.gradle b/build.gradle index cc5e19e3..c1dd63c8 100644 --- a/build.gradle +++ b/build.gradle @@ -57,7 +57,7 @@ compileTestGroovy { } def libertyAntVersion = "1.9.16" -def libertyCommonVersion = "1.8.35" +def libertyCommonVersion = "1.8.36-SNAPSHOT" dependencies { implementation gradleApi() diff --git a/src/main/groovy/io/openliberty/tools/gradle/tasks/AbstractServerTask.groovy b/src/main/groovy/io/openliberty/tools/gradle/tasks/AbstractServerTask.groovy index aa22c6d2..41a1926b 100644 --- a/src/main/groovy/io/openliberty/tools/gradle/tasks/AbstractServerTask.groovy +++ b/src/main/groovy/io/openliberty/tools/gradle/tasks/AbstractServerTask.groovy @@ -505,10 +505,9 @@ abstract class AbstractServerTask extends AbstractLibertyTask { configureMultipleAppsConfigDropins(serverNode) } - protected ServerConfigDocument getServerConfigDocument(CommonLogger log, File serverXML, File configDir, File bootstrapFile, - Map bootstrapProp, File serverEnvFile, boolean giveConfigDirPrecedence, Map libertyDirPropertyFiles) throws IOException { - if (scd == null || !scd.getServerXML().getCanonicalPath().equals(serverXML.getCanonicalPath())) { - scd = new ServerConfigDocument(log, serverXML, configDir, bootstrapFile, bootstrapProp, serverEnvFile, giveConfigDirPrecedence, libertyDirPropertyFiles) + protected ServerConfigDocument getServerConfigDocument(CommonLogger log, File serverXML, Map libertyDirPropertyFiles) throws IOException { + if (scd == null || !scd.getOriginalServerXMLFile().getCanonicalPath().equals(serverXML.getCanonicalPath())) { + scd = new ServerConfigDocument(log, serverXML, libertyDirPropertyFiles) } return scd @@ -520,8 +519,7 @@ abstract class AbstractServerTask extends AbstractLibertyTask { if (serverConfigFile != null && serverConfigFile.exists()) { try { Map props = combinedBootstrapProperties == null ? convertPropertiesToMap(server.bootstrapProperties) : combinedBootstrapProperties; - getServerConfigDocument(new CommonLogger(project), serverConfigFile, server.configDirectory, server.bootstrapPropertiesFile, props, server.serverEnvFile, - false, getLibertyDirectoryPropertyFiles(null)); + getServerConfigDocument(new CommonLogger(project), serverConfigFile, getLibertyDirectoryPropertyFiles(null)); if (scd != null && isLocationFound( scd.getLocations(), fileName)) { logger.debug("Application configuration is found in server.xml : " + fileName) configured = true diff --git a/src/main/groovy/io/openliberty/tools/gradle/tasks/DeployTask.groovy b/src/main/groovy/io/openliberty/tools/gradle/tasks/DeployTask.groovy index 92313838..cc9141b3 100644 --- a/src/main/groovy/io/openliberty/tools/gradle/tasks/DeployTask.groovy +++ b/src/main/groovy/io/openliberty/tools/gradle/tasks/DeployTask.groovy @@ -682,8 +682,7 @@ class DeployTask extends AbstractServerTask { File serverXML = new File(getServerDir(project).getCanonicalPath(), "server.xml") try { - scd = getServerConfigDocument(new CommonLogger(project), serverXML, server.configDirectory, - server.bootstrapPropertiesFile, combinedBootstrapProperties, server.serverEnvFile, false, getLibertyDirectoryPropertyFiles(null)) + scd = getServerConfigDocument(new CommonLogger(project), serverXML, getLibertyDirectoryPropertyFiles(null)) //appName will be set to a name derived from appFile if no name can be found. appName = scd.findNameForLocation(appFile) diff --git a/src/main/groovy/io/openliberty/tools/gradle/tasks/StartTask.groovy b/src/main/groovy/io/openliberty/tools/gradle/tasks/StartTask.groovy index 244d24b3..d952daeb 100644 --- a/src/main/groovy/io/openliberty/tools/gradle/tasks/StartTask.groovy +++ b/src/main/groovy/io/openliberty/tools/gradle/tasks/StartTask.groovy @@ -15,16 +15,11 @@ */ package io.openliberty.tools.gradle.tasks -import org.gradle.api.GradleException -import org.gradle.api.tasks.TaskAction -import org.gradle.api.Task -import org.gradle.api.logging.LogLevel import io.openliberty.tools.ant.ServerTask -import io.openliberty.tools.gradle.utils.* -import io.openliberty.tools.common.plugins.config.ServerConfigDocument import io.openliberty.tools.gradle.utils.CommonLogger - -import java.io.File +import org.gradle.api.GradleException +import org.gradle.api.Task +import org.gradle.api.tasks.TaskAction class StartTask extends AbstractServerTask { @@ -85,9 +80,7 @@ class StartTask extends AbstractServerTask { File serverConfigFile = new File(getServerDir(project), 'server.xml') if (serverConfigFile != null && serverConfigFile.exists()) { try { - Map props = combinedBootstrapProperties == null ? convertPropertiesToMap(server.bootstrapProperties) : combinedBootstrapProperties; - getServerConfigDocument(new CommonLogger(project), serverConfigFile, server.configDirectory, server.bootstrapPropertiesFile, props, server.serverEnvFile, - false, getLibertyDirectoryPropertyFiles(null)); + getServerConfigDocument(new CommonLogger(project), serverConfigFile, getLibertyDirectoryPropertyFiles(null)); if (scd != null) { appNames = scd.getNames() appNames += scd.getNamelessLocations().collect { String location -> diff --git a/src/main/groovy/io/openliberty/tools/gradle/tasks/UndeployTask.groovy b/src/main/groovy/io/openliberty/tools/gradle/tasks/UndeployTask.groovy index 3b66e588..9f02109c 100644 --- a/src/main/groovy/io/openliberty/tools/gradle/tasks/UndeployTask.groovy +++ b/src/main/groovy/io/openliberty/tools/gradle/tasks/UndeployTask.groovy @@ -79,8 +79,7 @@ class UndeployTask extends AbstractServerTask { File serverXML = new File(getServerDir(project).getCanonicalPath(), "server.xml") try { - getServerConfigDocument(new CommonLogger(project), serverXML, server.configDirectory, - server.bootstrapPropertiesFile, combinedBootstrapProperties, server.serverEnvFile, false, getLibertyDirectoryPropertyFiles(null)) + getServerConfigDocument(new CommonLogger(project), serverXML, getLibertyDirectoryPropertyFiles(null)) //appName will be set to a name derived from appFile if no name can be found. appName = scd.findNameForLocation(file) From 8506836324d145fd4ba5d5f28d7540dfa5d89e65 Mon Sep 17 00:00:00 2001 From: Arun Venmany Date: Wed, 13 Nov 2024 18:41:02 +0530 Subject: [PATCH 2/2] rolling back git workflow yaml to use main branch Signed-off-by: Arun Venmany --- .github/workflows/gradle.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index b09a4de1..f5797de1 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -39,9 +39,8 @@ jobs: - name: Checkout ci.common uses: actions/checkout@v3 with: - repository: arunvenmany-ibm/ci.common + repository: OpenLiberty/ci.common path: ci.common - ref: varProcessing - name: Checkout ci.ant uses: actions/checkout@v3 with: @@ -125,7 +124,7 @@ jobs: - name: Clone ci.ant, ci.common, ci.gradle repos to C drive run: | cp -r D:/a/ci.gradle/ci.gradle C:/ci.gradle - git clone https://github.com/arunvenmany-ibm/ci.common.git --branch varProcessing --single-branch C:/ci.common + git clone https://github.com/OpenLiberty/ci.common.git C:/ci.common git clone https://github.com/OpenLiberty/ci.ant.git C:/ci.ant # Cache mvn/gradle packages - name: Cache Maven packages