This article explains the necessary steps to change or add a (specific) property (e.g. webserverURL
) when only the implementation partner has access to the required system.
For this, Gradle Deployment Tools provide some features that are applied to the configured file(s) and properties. As an example, this document describes changing the webserverURL
, both globally and also domain-specific.
Generally it is recommended to use domain-specific configuration files (if you want to configure the webserver for domains) for each environment.
For changing a global property (e.g. webserverURL=example.com
) that is specified in the appserver.properties file (located in /server/share/system/config/cluster/), filters can be used. For details see Cookbook - Deployment Tools ICM 7.10 | Recipe: Change Deployed File Content With Filters.
For domain-specific configuration, the following configuration file specifies the relevant domain folder finder settings for the lookup of the domain-specific configuration:
<set finder="domain-folder" scope="domain" matches="^${environment}_[\w&&[^_]]*$" fileExtensions="properties,xml"/> <set finder="domain-folder" scope="domain" matches="^[\w&&[^_]]*$" fileExtensions="properties,xml"/>
Based on the finder configuration, the following files would be found/match: [IS_SHARE]/system/config/domains/<domain>/<environment>_*.properties
For information on how to add domain-specific files with the matching names and correct WebServer URLs as custom files via the deployment, see Cookbook - Deployment Tools ICM 7.10 | Recipe: Deploy Custom Files.
Example for configured environment names are:
Directory: [IS_SHARE]/system/config/domains/
./<domain1>/uatedit_Url.properties
./<domain1>/uatlive_Url.properties
./<domain1>/prodedit_Url.properties
./<domain1>/prodlive_Url.properties
As the changes cannot be applied directly to the target system, it is necessary to use a deploy.gradle file in the project. The filters function of Gradle Deployment Tools allows to overwrite the setting ("intershop.WebServerURL") during the deployment. deploy.gradle then could then look as follows:
buildscript { dependencies { classpath 'com.intershop:deployment-bootstrap:+' } } apply plugin: com.intershop.deploy.assembly.TargetPlugin apply plugin: com.intershop.deploy.infrastructure.InfrastructureDeploymentPlugin deployment{ filters { overrideProperties('setWebserverURL') { dir = target.shareDirectory include 'system/config/cluster/appserver.properties' properties['intershop.WebServerURL'] = 'https://www.example1.com:8080' } } }
The domain-specific files with the matching names and correct webserverURL
can be added as content via the deployment.
To follow the additional (domain-specific) approach, use a "CustomProperty" (here: DomainSpecificProperties
) to copy your custom file to the target.
deployment{ files { DomainSpecificProperties { // Copy a single file from the root project from new File(projectDir, 'uatedit_Url.properties') // Define target of the copy operation into new File(target.shareDirectory, 'system/config/domains/<yourSite>/') } } }