Expand my Community achievements bar.

SOLVED

wanted to divide the AEM Maven Build and Deploy in Jenkins

Avatar

Level 3

Hi Team,

  I wanted to divide the build and deploy jobs in Jenkins for the AEM maven project. Is that something can be able to do?or what other options do I have?

Thanks In Advance.

1 Accepted Solution

Avatar

Correct answer by
Level 4

You should define one Maven profile per environment (dev, qa, uat, prod) and for each one of them, you have to define all steps required to build and deploy  (e.g: custom steps, ips configuration, etc) per environment.

The options are:

1) To create one job per environment and configure each of them (parameters, maven command, etc) depending on the environment selected, or

2) Have one job to build and deploy all environments, which implies to read all properties (environments and parameters per environments) and depending on the environment selected.

View solution in original post

5 Replies

Avatar

Level 4

First of all, there are many ways to resolve this.

For example,  you can do it like this

  1. define 2 differents maven profiles in your pom.xml file, one for build and another one for deploy.
  2. create 2 Jenkins jobs: one for build and another one for deploy.
  3. Configure build job with all maven command associated with build process (e.g: mvn clean install -PbuildApp -PbuildBundle1)
  4. Configure deploy job  with all maven command associated with deploy process (e.g: mvn clean install -Pdeploy)
  5. you can connect build and deploy job, connecting via Jenkins, it means at the moment build's job complete successfully trigger deploy's job. 

Please note few things

  • jenkins plugins and global config must be corrected set up to ensure build and deploy successfully.
  • make sure all ip's belong into the whitelist.

Let me know if you need more details to resolve this

Avatar

Level 10

What is the reason for this. Using Maven, you can build and compile projects.

Avatar

Level 3

Hi Diego, Thanks for the info. Let me try that way. I am very new to setting up Jenkin jobs. This is my first time doing.

I will follow this way. Thanks

Avatar

Level 3

Hi Scott,

     For the DEV integration environment we wanted to build and deploy in one shot but for other environments say QA, UAT, and Prod we don't want to build the same code we wanted to deploy the DEV build to all these environments.  That is the only main reason.

Thanks

Uma

Avatar

Correct answer by
Level 4

You should define one Maven profile per environment (dev, qa, uat, prod) and for each one of them, you have to define all steps required to build and deploy  (e.g: custom steps, ips configuration, etc) per environment.

The options are:

1) To create one job per environment and configure each of them (parameters, maven command, etc) depending on the environment selected, or

2) Have one job to build and deploy all environments, which implies to read all properties (environments and parameters per environments) and depending on the environment selected.