Expand my Community achievements bar.

SOLVED

Package installation

Avatar

Level 6

Hi Team,

 

Is there any way to do following:

 

1) Create Content Package from PROD env.

2) Run the any cron job daily midnight which install same package in some other env lets say DEV or STAGE.

 

NOTE: All instances are in Google cloud.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@arvind :

You can write a bash script by using curl command to create a package . once created you can keep that package in shared folder or server which can be accessible to your lower environments.

 

Then in your stage or dev , you can write a script again to fetch the package and using curl command again you can install that in your environment.

#create package

curl -u admin:admin -X POST http://localhost:4502/crx/packmgr/service/.json/etc/packages/my_packages/testpackage3?cmd=create \
-d packageName=testpackage3 \
-d groupName=my_packages

 

# add filters
curl -u admin:admin -X POST http://localhost:4502/crx/packmgr/update.jsp \
-F path=/etc/packages/my_packages/testpackage3.zip -F packageName=testpackage3 \
-F groupName=my_packages \
-F filter="[{\"root\" : \"/etc/tags\", \"rules\": [{\"modifier\" : \"include\", \"pattern\" : \"/.*\"}]}]" \
-F '_charset_=UTF-8'

 

# build package
curl -u admin:admin -X POST http://localhost:4502/crx/packmgr/service/.json/etc/packages/my_packages/testpackage3.zip?cmd=build

 

Thanks

Siva

Thanks,
Siva

View solution in original post

3 Replies

Avatar

Community Advisor

I think there can be a way to achieve it.

thru shell script with the help of curl commands you can create a package build it and replicate it.

Maybe you need to setup one replication agent for this, if there is not any already available.

CURL list can be found one below link:

https://experienceleague.adobe.com/docs/experience-manager-64/administering/operations/curl.html?lan...

Hope this helps.

Umesh Thakur

Avatar

Community Advisor

@arvind If you are looking for a solution in AEMaaCS this is little complicated and not suggestable.

 

But if you are using a solution on-prem then it is possible with curl commands solution in the link provided

https://experienceleague.adobe.com/docs/experience-manager-64/administering/operations/curl.html?lan...

 

But also it is never recommanded to have a daily sync job on the PROD server. 

Avatar

Correct answer by
Community Advisor

@arvind :

You can write a bash script by using curl command to create a package . once created you can keep that package in shared folder or server which can be accessible to your lower environments.

 

Then in your stage or dev , you can write a script again to fetch the package and using curl command again you can install that in your environment.

#create package

curl -u admin:admin -X POST http://localhost:4502/crx/packmgr/service/.json/etc/packages/my_packages/testpackage3?cmd=create \
-d packageName=testpackage3 \
-d groupName=my_packages

 

# add filters
curl -u admin:admin -X POST http://localhost:4502/crx/packmgr/update.jsp \
-F path=/etc/packages/my_packages/testpackage3.zip -F packageName=testpackage3 \
-F groupName=my_packages \
-F filter="[{\"root\" : \"/etc/tags\", \"rules\": [{\"modifier\" : \"include\", \"pattern\" : \"/.*\"}]}]" \
-F '_charset_=UTF-8'

 

# build package
curl -u admin:admin -X POST http://localhost:4502/crx/packmgr/service/.json/etc/packages/my_packages/testpackage3.zip?cmd=build

 

Thanks

Siva

Thanks,
Siva