Expand my Community achievements bar.

SOLVED

Best Practice for automating AEM Bundles Deployment (On Prem)

Avatar

Level 3

I am exploring options for automating the deployment of the Bundles in the On Prem instance. I have seen various options available for the cloud however not many for On Prem.

 

The requirement is for automating the build and deploying bundles only to the On Prem instances from local. As of now, we have been separately creating bundles and installing them straight from the felix console for the On Prem instance /system/console/bundles after doing a maven build locally.

 

Any suggestion or best practice (documentation if any) would be helpful.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 5
  1. Even when your AEM instance uses SSO for authentication, you can still create user accounts directly in AEM for using with curl commands.
  2. Additionally, it's possible to trigger builds and execute curl commands on commits using the .gitlab-ci.yml file. For more details, refer to GitLab CI/CD Quick Start.
  3. If you're using Jenkins, you can build only the core project by specifying the directory and Maven command in your build steps. You can also deploy a specific bundle by passing its name in the curl command. More information is available in the Jenkins Pipeline documentation

View solution in original post

5 Replies

Avatar

Level 2

 

You can try:

mvn clean install sling:install

This will build the bundle and deploy it directly to your AEM instance.

 

https://sling.apache.org/components/sling-maven-plugin/install-mojo.html

 

Avatar

Level 5

You can automate the installation of a bundle in AEM using the curl command. Create a shell or batch script according to your environment and requirements.

Command to Install a Bundle:

curl -u admin:admin -F action=install -F bundlestartlevel=20 -F bundlefile=@"name_of_jar.jar" http://localhost:4505/system/console/bundles
  • Replace admin:admin with your AEM credentials.
  • Replace name_of_jar.jar with the actual filename of your bundle.
  • This command installs the bundle and sets the start level to 20.

Automating with a CI/CD Pipeline
Instead of building code locally and deploying manually, consider setting up a CI/CD pipeline. Using tools like Jenkins, Azure DevOps, or other similar CI/CD platforms can streamline your build and deployment process.

Avatar

Level 3

Thanks for the reply and the suggestion. I have few questions on this.

1. We are using SSO so is there any other way to replace with admin:admin credentials?

2. Can we run the batch script integrating with gitlab once the commit has been done?

3. For the automation with CI/CD pipeline, how do we configure for the individual bundles deployment only? I know I have seen jenkins integration with the whole maven project structure for AEM archetype. However, not seen for individual bundles setup.

Avatar

Level 5

@BinaryAlchemy11 

 

1. Me, I am using smth like this in my local

curl 'http://localhost:4592/content/dam/ttaaaacs' -X POST -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" -H "Authorization: Basic YWRtaW46YWRtaW4=" --data-binary '{}'

Maybe this helps. See also https://reqbin.com/req/c-haxm0xgr/curl-basic-auth-example

But for SSO I think things are more complicated. I found this : https://www.ssocircle.com/en/developer-tutorial-saml-testing-using-curl-and-ssocheck-api/developer-t... .

Avatar

Correct answer by
Level 5
  1. Even when your AEM instance uses SSO for authentication, you can still create user accounts directly in AEM for using with curl commands.
  2. Additionally, it's possible to trigger builds and execute curl commands on commits using the .gitlab-ci.yml file. For more details, refer to GitLab CI/CD Quick Start.
  3. If you're using Jenkins, you can build only the core project by specifying the directory and Maven command in your build steps. You can also deploy a specific bundle by passing its name in the curl command. More information is available in the Jenkins Pipeline documentation