Announcement: You can find the guides for Commerce 7.5 and later on the new Elastic Path Documentation site. This Developer Center contains the guides for Commerce 6.13.0 through 7.4.1.Visit new site

This version of Elastic Path Commerce is no longer supported or maintained. To upgrade to the latest version, contact your Elastic Path representative.

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.

Note:

See Starting Construction Guide (Prerequisites) if you don't have a copy of the DevOps Automation accelerator.

Configure and run the job generator

  1. Unzip the DevOps Automation Accelerator Kit into a local directory.
  2. 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-Commerce-for-AMC 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.
  3. 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.
  4. 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

  1. Login to the Jenkins master via SSH.
  2. Stop Jenkins
    sudo service jenkins stop 
  3. 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.
  4. Change permissions on the jobs
    sudo chmod 777 /var/lib/jenkins/jobs/*
  5. Restart Jenkins.
    sudo service jenkins start

Working with a single Git repository

Warning:

The generated Jenkins jobs assume that each project is in a separate Git repository.

If you are using a single Git repository for all projects, the Jenkins job configurations will need to be adjusted manually.

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:

  1. Commerce Engine Build
  2. Cortex EP Integration Build
  3. Extensions Build
  4. EP for AEM Commerce Build (if applicable)
  5. Geometrixx Demo Build (if applicable)
  6. CM Client Build
  7. Deployment Package
  8. Commerce Engine Tests
  9. Deploy to Dev Server