AEM – Garbage Collection Automation

DESCRIPTION:

Performing Garbage Collection on an AEM instance. Which is Automated using cURL and Jenkins. In this post we are focusing on AEM deployed on an Windows Server. So, powershell script will be used to trigger the Garbage Collection.

PRE-REQUISITES:

AEM – it is assumed that AEM instance is up and running

cURL – it is assumed that cURL is already installed and configured on the windows server

Jenkins – it is assumed that Jenkins server is up and running and also assumed that you already know how to create a Job on Jenkins

LIMITATIONS:

Script will be modified in upcoming updates to accommodate the respective AEM version.

As of Now script will run on AEM 6.3 ONLY

SYNOPSIS:

We shall check if we are running Garbage Collection on Author/Publish and based on that we shall set the CQ_PORT to 4502/4503 appropriately

we shall check the OAK Version of the AEM instance and based on the OAK version we shall determine which AEM version we are running

Based on the AEM version we shall trigger the appropriate Garbage Collection command.

GUIDE:

Step-01: Add the Project Description

Description of the Jenkins Job

Step-02: Setup House Keeping to minimise the no# of builds

House keeping Jenkins by restricting the max # of build and retention

Step-03: Define Parameters for the Build – Remote Host Parameter

Remote Host on which the Garbage Collection will be TriggeredUsername for logging-in to Remote HostPassword for logging-in to Remote HostType of AEM instance – Author/PublishUsername of the AEM instancePassword of the AEM instance