-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For Var processing changes in ci.common testing #919
base: main
Are you sure you want to change the base?
Changes from all commits
92ca1b8
8a321b4
30a0cc4
9e6cada
319ef84
51dedff
19c0f0c
5c6d2b9
8a5d551
1a7a7fc
36ba635
85b8432
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -505,10 +505,9 @@ abstract class AbstractServerTask extends AbstractLibertyTask { | |
configureMultipleAppsConfigDropins(serverNode) | ||
} | ||
|
||
protected ServerConfigDocument getServerConfigDocument(CommonLogger log, File serverXML, File configDir, File bootstrapFile, | ||
Map<String, String> bootstrapProp, File serverEnvFile, boolean giveConfigDirPrecedence, Map<String, File> 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, Map<String, File> libertyDirPropertyFiles) throws IOException { | ||
if (scd == null) { | ||
scd = new ServerConfigDocument(log, libertyDirPropertyFiles) | ||
} | ||
|
||
return scd | ||
|
@@ -520,8 +519,7 @@ abstract class AbstractServerTask extends AbstractLibertyTask { | |
if (serverConfigFile != null && serverConfigFile.exists()) { | ||
try { | ||
Map<String,String> props = combinedBootstrapProperties == null ? convertPropertiesToMap(server.bootstrapProperties) : combinedBootstrapProperties; | ||
getServerConfigDocument(new CommonLogger(project), serverConfigFile, server.configDirectory, server.bootstrapPropertiesFile, props, server.serverEnvFile, | ||
false, getLibertyDirectoryPropertyFiles(null)); | ||
scd = getServerConfigDocument(new CommonLogger(project), getLibertyDirectoryPropertyFiles(null)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't need to get props anymore at line 521. |
||
if (scd != null && isLocationFound( scd.getLocations(), fileName)) { | ||
logger.debug("Application configuration is found in server.xml : " + fileName) | ||
configured = true | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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), getLibertyDirectoryPropertyFiles(null)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You don't need to get serverXML anymore at line 682. |
||
|
||
//appName will be set to a name derived from appFile if no name can be found. | ||
appName = scd.findNameForLocation(appFile) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,8 +86,7 @@ class StartTask extends AbstractServerTask { | |
if (serverConfigFile != null && serverConfigFile.exists()) { | ||
try { | ||
Map<String,String> props = combinedBootstrapProperties == null ? convertPropertiesToMap(server.bootstrapProperties) : combinedBootstrapProperties; | ||
getServerConfigDocument(new CommonLogger(project), serverConfigFile, server.configDirectory, server.bootstrapPropertiesFile, props, server.serverEnvFile, | ||
false, getLibertyDirectoryPropertyFiles(null)); | ||
scd = getServerConfigDocument(new CommonLogger(project), getLibertyDirectoryPropertyFiles(null)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think the line before this needs to be done anymore. The bootstrap.properties file in the server dir will be used and should have all the combined properties already. |
||
if (scd != null) { | ||
appNames = scd.getNames() | ||
appNames += scd.getNamelessLocations().collect { String location -> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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)) | ||
scd= getServerConfigDocument(new CommonLogger(project), getLibertyDirectoryPropertyFiles(null)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think you need to get serverXML at line 79 any more. |
||
|
||
//appName will be set to a name derived from appFile if no name can be found. | ||
appName = scd.findNameForLocation(file) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this seems problematic. Before we were checking to see if the path for the server.xml file changed and if so we recreated the ServerConfigDocument. Now we cannot tell if it changed. Makes me wonder if we should always create a new ServerConfigDocument, but that is a lot of processing that happens.