Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Automating AEM bulk Publishing Using Jenkins.

Posted on Sep 23 OverviewThis article explains how to use a Jenkins job and shell script to activate and deactivate various pages or paths in AEM. Once you have done creating or modifying your page next step is to make that page publish. Then again, navigate to that page’s correct path in the Website Console, then right-click the page and select the "Active" option. What If you have multiple pages to active, it’s a little bit time-consuming. So, using a single Jenkins job, you may activate several pages simultaneously. Before I continue, let me give a little introduction about the "cURL tool”What is cURL?The term stands for “Curl URL Request Library”. A cURL is a command-line tool it is suitably used for transferring and manipulating data to the server or from the server. It Follows the rule REQUEST-RESPONSE, a client that requests something from a server and receives an answer from the server. It can send data using a variety of protocols, including HTTP, HTTPS, FTP, SCP, SMTP, LDAP, etc. It is excellent for automating processes, and if you know how to script, you can develop strong tools that can simplify your work process. Most of the OS systems now come with cURL pre-installed.To verify open CMD/TERMINAL and type “curl –help)cURL use in AEM.Since AEM is based on REST protocols, you may do a certain task, including building, installing, and replicating packages, using curl. Additionally, check OSGI configuration, manage users and groups, lock and unlock page, and even more.You probably have a fundamental understanding of curl. Let’s now turn this blog's main goal into execution.What is Jenkins? Jenkins is a free and open-source automation tool that may be used to automate any kind of task related to building, testing, delivering, or deploying software. Today, CI/CD workflow is frequently implemented by IT firms. It can be installed on any computer that has [Java Runtime Environment] JRE.How to create a Jenkins job that activates and deactivates multiple AEM pages.Here, we are choosing the freestyle job in this demo.The freestyle job is a flexible alternative that is simple to set up and use. Also, it gives us more options for other build jobs.Follow the steps mentioned below to create a job.Here, I've given the option the name "user_input" and included a description. Up to this point, we have just covered the user input field by providing input as the pages' path using the first parameter. We have specified the action to be taken, whether to activate or deactivate the page, in the second parameter.A new prompt will pop up continuing to follow that. Here, you must enter the authentic login and password for your AEM instance in two different variables, one for the username and the other for the password. (Later in the script we have to call that variable)Select your credentials from the credentials store after that.If you haven’t already stored your credential, you have to click on Add button and enter your real username and password details.Note: You can manually add credentials from the manage Jenkins's option, if they do not really appear on the job page. Refer to the screenshot below.Go to the Jenkins home dashboard > Left panel option> Manage Jenkins >Manage Credentials >system>global Credentials >Add Credentials >Enter real username and password> Click create.OR The build trigger option in the job's SCM section allows you to invoke the script.Your job is now ready to build after you click the save option.If the page's published status is Green, it has been successfully activated.Jenkins Output for activating page:Likewise, you must follow Step 7 and choose the Deactivate option if you want to deactivate the page. If the page's published status is Red, it has been successfully deactivated.Jenkins Output for deactivating page:ConclusionSo here it is! You now have a basic understanding of how the curl command works. In using AEM, it can be helpful to automate several daily tasks. Things like managing packages, bundles, node, pages, users and groups, etc. In addition, Jenkins is a great CI/CD tool with customization options, and the best part is that this is free to use. and very beneficial when it comes to reducing workloads through automation. Thank you for reading, and I hope you find this blog to be useful.Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well Confirm For further actions, you may consider blocking this person and/or reporting abuse pongsatt - Nov 3 '18 pongsatt - Nov 3 '18 Jean-Denis Gallego - May 6 '18 Judith Pivoteau - Apr 17 '18 Once suspended, chavhan will not be able to comment or publish posts until their suspension is removed. Once unsuspended, chavhan will be able to comment and publish posts again. Once unpublished, all posts by chavhan will become hidden and only accessible to themselves. If chavhan is not suspended, they can still re-publish their posts from their dashboard. Note: Once unpublished, this post will become invisible to the public and only accessible to Akash. They can still re-publish the post if they are not suspended. Thanks for keeping DEV Community safe. Here is what you can do to flag chavhan: chavhan consistently posts content that violates DEV Community's code of conduct because it is harassing, offensive or spammy. Unflagging chavhan will restore default visibility to their posts. DEV Community — A constructive and inclusive social network for software developers. With you every step of your journey. Built on Forem — the open source software that powers DEV and other inclusive communities.Made with love and Ruby on Rails. DEV Community © 2016 - 2023. We're a place where coders share, stay up-to-date and grow their careers.



This post first appeared on VedVyas Articles, please read the originial post: here

Share the post

Automating AEM bulk Publishing Using Jenkins.

×

Subscribe to Vedvyas Articles

Get updates delivered right to your inbox!

Thank you for your subscription

×