Goran Petanjek
Goran Petanjek

Reputation: 454

How to exclude urlrewriterules.xml and domainsplittings.xml from being copied to config dir on serverDeploy task

We are trying to put our custom domainsplittings.xml and urlrewriterules.xml files wit our url rewrite rules to share/system/config/cluster folder, but every time we run deployServer gradle task, those files are copied from bc_urlrewrite.zip from local gradle repo.

We already tried to define custom deployment/deploy.gradle file in one of our cartridges with following code:

project(':bc_urlrewrite') {
  afterEvaluate {
      deployment.files.share {
          exclude { 
              new File(destinationDir, it.path) == new File(target.shareDirectory, 'system/config/cluster/domainsplittings.xml')
              new File(destinationDir, it.path) == new File(target.shareDirectory, 'system/config/cluster/urlrewriterules.xml')                       
          }
      }                                    
  }

}

as stated here: https://support.intershop.com/kb/index.php/Display/282B92#Cookbook-DeploymentToolsICM7.9-Recipe:ReplaceaFileDeployedbyAnotherComponent but this does not work. Files are still copied from bc_urlrewrite.zip on deployServer task.

Are we doing something wrong? We don't need those files because they contains url rewrite rules for demo intronics store.

Thank you for your help!

Upvotes: 1

Views: 58

Answers (1)

Willem Evertse
Willem Evertse

Reputation: 1239

Yeah, the documentation isn't very clear and it use to be that you could simple overload the setting. Can you try the following configuration.

apply plugin: com.intershop.deploy.cartridge.CartridgeDeploymentPlugin
   if (target.includeShare && findProject(':bc_urlrewrite')) {
       project(':bc_urlrewrite') {
           def excludeFiles = {
               deployment.files.share {
                   exclude 'system/config/cluster/urlrewriterules.xml'
                   exclude 'system/config/cluster/domainsplittings.xml'
               }
           }
           if (project.state.executed) {
               excludeFiles()
           } else {
               afterEvaluate(excludeFiles)
           }
       }
   }

Upvotes: 3

Related Questions