Jenkins Job Setup
Jenkins Job Setup
Overview
The DevOps Automation Accelerator Kit provides tools to generate Jenkins jobs that can be copied to the server.
See Starting Construction Guide (Prerequisites) if you don't have a copy of the DevOps Automation accelerator.
Configure and run the job generator
- Unzip the DevOps Automation Accelerator Kit into a local directory.
- Configure the following client-specific values in jenkins-jobs/config/global.properties.
Property Description commerce.engine.scm.urlextensions.scm.urlcmclient.scm.urldevops.scm.url
ep.aem.commerce.scm.url geometrixx.demo.scm.url
The SCM URLs for the EP projects. Currently only Git repositories are supported, but it should be straightforward to modify the templates to support other SCM systems.
ep.aem.commerce.scm.url and geometrixx.demo.scm.url are only required for EP-for-AMC-Fall-2014-SP2 release package.
Note:if Jenkins is authenticating using an SSH key remember to use the SSH clone URL, otherwise use the HTTPS clone URL.
scm.branch The branch to build.
client.display.name Display name for the client project. It MUST NOT contain embedded spaces or other characters that are subject to URL encoding. Hyphens and underscores are safe.
num.builds.to.keep The number of build logs to keep. num.build.artifacts.to.keep The number of build artifact versions to keep. This number should be fairly small to limit excessive disk space usage. email.recipient.list The list of recipients to be notified of build failures. Multiple recipients must be separated by spaces. jenkins.scm.credential.id Leave blank. Not currently used. deployment.properties.file The properties file in the deployment folder to be used to generate deployment jobs. - Configure the following deployment specific values in jenkins-jobs/config/deployment/dev.properties:
Property Description deploy.environment Identifies the environment to be deployed. The value must match a directory in devops/pusher-package/environments. deploy.environment.name The display name of the deploy environment. It MUST NOT contain embedded spaces or other characters that are subject to URL encoding. Hyphens and underscores are safe. deploy.environment.hostname The hostname or IP address of the deployer host. This is the server where the Pusher scripts are executed. deploy.environment.user The username to login to the deployer hosts. - Run the Jenkins job generator from the command line:
cd jenkins-jobs mvn clean package -P basic-jobs,deployment-jobs
Copy jobs to the server
- Login to the Jenkins master via SSH.
- Stop Jenkins
sudo service jenkins stop
- Copy the generated jobs from jenkins-jobs/target/jobs to /var/lib/jenkins/jobs on the server. If you do not have source code for ep-aem-commerce project, you do not need to copy the job for it.
- Change permissions on the jobs
sudo chmod 777 /var/lib/jenkins/jobs/*
- Restart Jenkins.
sudo service jenkins start
Activate the jobs
The jobs are created in an inactive state. Using the Jenkins control panel, activate the jobs and test them in the following order:
- Commerce Engine Build
- Extensions Build
- EP for AEM Commerce Build (if applicable)
- Geometrixx Demo Build (if applicable)
- CM Client Build
- Deployment Package
- Commerce Engine Tests
- Deploy to Dev Server