Hi,
I am using a series of CURL request to create my package.
What I am doing currently: I created a new package, added filters to it and then built the package.
What I want to do: Add more filters to this package and build it again.
I am wondering if there is a way to update an existing package. I have been searching around to see how we can do this but have failed. Can someone please help me?
Thanks.
Solved! Go to Solution.
Views
Replies
Total Likes
I don't think there is option to append the filters.
You need use:-
For adding filters:
# add filters
curl -u admin:admin -X POST http://localhost:4502/crx/packmgr/update.jsp \
-F path=/etc/packages/my_packages/testpackage.zip -F packageName=testpackage \
-F groupName=my_packages \
-F filter="[{\"root\" : \"/content/my-site\", \"rules\": [{\"modifier\" : \"exclude\", \"pattern\" : \"/content/my-site/(.*)/folder-to-exclude(/.*)?\"}]}]" \
-F '_charset_=UTF-8'
Source Link:- AEM/CQ cURL: Adding include/exclude rules to package filters · GitHub
~kautuk
Views
Replies
Total Likes
Hi
For adding filters:
# add filters
curl -u admin:admin -X POST http://localhost:4502/crx/packmgr/update.jsp \
-F path=/etc/packages/my_packages/testpackage.zip -F packageName=testpackage \
-F groupName=my_packages \
-F filter="[{\"root\" : \"/content/my-site\", \"rules\": [{\"modifier\" : \"exclude\", \"pattern\" : \"/content/my-site/(.*)/folder-to-exclude(/.*)?\"}]}]" \
-F '_charset_=UTF-8'
# build package
curl -u admin:admin -X POST http://localhost:4502/crx/packmgr/service/.json/etc/packages/my_packages/testpackage.zip?cmd=build
Rebuild an existing package in CQ
curl -u admin:admin -X POST http://localhost:4505:/crx/packmgr/service/.json/etc/packages/name_of_package.zip?cmd=build
Reference posts are:-
Link:- https://gist.github.com/sergeimuller/2916697
Link:- https://gist.github.com/nateyolles/dd4ebe0a6b83c369029b
I hope this would help you.
~kautuk
Views
Replies
Total Likes
kautuksahni wrote...
Hi
For adding filters:
# add filters
curl -u admin:admin -X POST http://localhost:4502/crx/packmgr/update.jsp \
-F path=/etc/packages/my_packages/testpackage.zip -F packageName=testpackage \
-F groupName=my_packages \
-F filter="[{\"root\" : \"/content/my-site\", \"rules\": [{\"modifier\" : \"exclude\", \"pattern\" : \"/content/my-site/(.*)/folder-to-exclude(/.*)?\"}]}]" \
-F '_charset_=UTF-8'
# build package
curl -u admin:admin -X POST http://localhost:4502/crx/packmgr/service/.json/etc/packages/my_packages/testpackage.zip?cmd=build
Rebuild an existing package in CQ
curl -u admin:admin -X POST http://localhost:4505:/crx/packmgr/service/.json/etc/packages/name_of_package.zip?cmd=build
Reference posts are:-
Link:- https://gist.github.com/sergeimuller/2916697
Link:- https://gist.github.com/nateyolles/dd4ebe0a6b83c369029b
I hope this would help you.
~kautuk
Yeah I have done this already. My issue is how do I add more filters to this existing package? If I add filters it overwrites the existing ones. I want to add them instead of overwriting the existing filters.
Views
Replies
Total Likes
kautuksahni wrote...
Hi
For adding filters:
# add filters
curl -u admin:admin -X POST http://localhost:4502/crx/packmgr/update.jsp \
-F path=/etc/packages/my_packages/testpackage.zip -F packageName=testpackage \
-F groupName=my_packages \
-F filter="[{\"root\" : \"/content/my-site\", \"rules\": [{\"modifier\" : \"exclude\", \"pattern\" : \"/content/my-site/(.*)/folder-to-exclude(/.*)?\"}]}]" \
-F '_charset_=UTF-8'
# build package
curl -u admin:admin -X POST http://localhost:4502/crx/packmgr/service/.json/etc/packages/my_packages/testpackage.zip?cmd=build
Rebuild an existing package in CQ
curl -u admin:admin -X POST http://localhost:4505:/crx/packmgr/service/.json/etc/packages/name_of_package.zip?cmd=build
Reference posts are:-
Link:- https://gist.github.com/sergeimuller/2916697
Link:- https://gist.github.com/nateyolles/dd4ebe0a6b83c369029b
I hope this would help you.
~kautuk
Yeah I have done this already. My issue is how do I add more filters to this existing package? If I add filters it overwrites the existing ones. I want to add them instead of overwriting the existing filters.
Views
Replies
Total Likes
Bump....anyone?
Views
Replies
Total Likes
Bump....anyone?
Views
Replies
Total Likes
I believe Kautuk answer is the best you will get here. Even when you build with Package Manager - it overwrites existing ones.
Views
Replies
Total Likes
I believe Kautuk answer is the best you will get here. Even when you build with Package Manager - it overwrites existing ones.
Views
Replies
Total Likes
I don't think there is option to append the filters.
You need use:-
For adding filters:
# add filters
curl -u admin:admin -X POST http://localhost:4502/crx/packmgr/update.jsp \
-F path=/etc/packages/my_packages/testpackage.zip -F packageName=testpackage \
-F groupName=my_packages \
-F filter="[{\"root\" : \"/content/my-site\", \"rules\": [{\"modifier\" : \"exclude\", \"pattern\" : \"/content/my-site/(.*)/folder-to-exclude(/.*)?\"}]}]" \
-F '_charset_=UTF-8'
Source Link:- AEM/CQ cURL: Adding include/exclude rules to package filters · GitHub
~kautuk
Views
Replies
Total Likes
Views
Likes
Replies