AEM – Automation — Package Deployment

SYNOPSIS:

Following is the guide to Download, Install, Replicate AEM Package and Flush the Dispatcher Cache. The Job can be achieved in several different ways, and there is always room for improvement. In this tutorial we shall download the package from lower environments and install the downloaded package to a different environment.

Tools Used:

Powershell

cURL

Windows 10 Enterprise

Jenkins

Prerequisites:

ACS Commons Package, make sure the package is available on the Author instance where the package is being installed, Script utilizes the acs commons dispatcher flush component to trigger the dispatcher flush agent under the Replication — agents on author.

Compatibility — Check package compatibility with the following at Compatibility chart and Download the respective package

STEP-04: Automating the Package deployment using Jenkins and Powershell

Following is the process, where package name is given as input to the build job on Jenkins. Then based on the package name, script will parse through AEM [Download Host], if found, will gather DownloadName, Groupname of the package.

Project Description

Go to General TAB

Add the project description

Housekeeping

Select the House keeping strategy for the project

Mention the number of days to keep the builds

Mention max number of builds to keep

Extensible Choice Parameter

We shall use the extensible choice parameter, if not already install, got to plugin manager and install the plugin, see prerequisites

Select the Extensible choice parameter

Name of the Variable in the Script

Describe the Variable

Select the Textarea Choice parameter

Add the choices as shown in the above figure

Select the option, which would be displayed as the default choice

Enable Editable option, to manually add package name, if package is not listed on the list

Parameter to display all of selected choices

Bindings — AEM username and password

Use the credentials bindings parameter to enter the credentials for AEM instances

Enable bindings by selecting Use secrets option under Build Environment

Binding parameter

Use the separated option

Declare username variable

Declare password variable

Choose the credentials from credentials list to assign them to above variables

Build — Windows Powershell

Select Build Step

Add windows powershell from the list

Add the powershell script from STEP-03

Post-Build Action — Clean Workspace

Clean up the workspace after building the project

Building Project

Select “Build with Parameters“

click on the Textarea, Can manually enter package name here if not in list

Select the desired package from the list

BBuild Output

Console output of the Build

Describes the Environment, AEM hosts, Port numbers, Package name and Group