This 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 “Activate” option. What If you have multiple pages to activate, it’s a little bit time-consuming. So, using a single Jenkins job, you may activate or deactivate 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 activate and deactivate multiple AEM pages.
Here, we are choosing the freestyle job.
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.