Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

CURL command for Merge Mode in AEM 6.5

Avatar

Level 2

Hello everyone, 

We have a special request from the client where in we need change the mode in which package is created and installed using curl command to "Merge". Currently, we are using curl commands via Jenkins Groovy to create the package and install them from one instance to another. But since we don't specify any mode , the default behaviour is "Replace" for the contents which get installed on a specific instance. 

 

Is there a way we can achieve this workspace filter using curl command ?

 

@arunpatidar @venkateshsha 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @anirudhanand 

 

Its not possible to append the merge mode via curl command.

 

You can use the below steps to append mode to filter:

  • Unzip the package zip file on your computer - jar -xvf append_mode-1.0.zip META-INF/vault/filter.xml
  • Open the file META-INF/vault/filter.xml in a text editor.
  • Add mode="merge" to the <filter ...> tag. Example:

<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
    <filter root="/content/we-retail/us/en/products/women" mode="merge" />
</workspaceFilter>

 

  • Re-zip the modified package contents so it includes the change - jar -uvf  append_mode-1.0.zip META-INF/vault/filter.xml

 


Aanchal Sikka

View solution in original post

3 Replies

Avatar

Community Advisor

HI @anirudhanand ,

I believe, you can achieve this by setting up flag -F

curl -u <user>:<password> -F cmd=install -F mode=merge http://localhost:4502/crx/packmgr/service/.json/etc/packages/my_packages/test.zip

Hope that helps!

Regards,

Santosh

Avatar

Level 2

Hi Santosh,

 

Thank you so much for this solution but this doesn't seem to work for me. When I tried the same the the content does get replaced. Also will there be any update on the filter.xml on using the -F mode=merge since I couldn't find it to be updated?

 

Could you please guide here.

 

Thanks,

Anirudh

Avatar

Correct answer by
Community Advisor

Hello @anirudhanand 

 

Its not possible to append the merge mode via curl command.

 

You can use the below steps to append mode to filter:

  • Unzip the package zip file on your computer - jar -xvf append_mode-1.0.zip META-INF/vault/filter.xml
  • Open the file META-INF/vault/filter.xml in a text editor.
  • Add mode="merge" to the <filter ...> tag. Example:

<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
    <filter root="/content/we-retail/us/en/products/women" mode="merge" />
</workspaceFilter>

 

  • Re-zip the modified package contents so it includes the change - jar -uvf  append_mode-1.0.zip META-INF/vault/filter.xml

 


Aanchal Sikka