start portlet menu bar

HCLSoftware: Fueling the Digital+ Economy

Display portlet menu
end portlet menu bar
Close
Select Page

This tutorial shows how to setup and deploy a parametrized Jenkins job from an HCL Accelerate pipeline.

Requirements

1. Create Jenkins Job for PROD Deployment

1.1 Create a New Pipeline Job

Create a second pipeline job, this time for deployment to a fictitious production or “PROD” environment.

HCL Accelerate VSM with Jenkins

HCL Accelerate VSM with Jenkins

1.2 Configure the Pipeline Script

Copy and paste the script below as a pipeline script. Similar to the script we used for Build, DEV, and QA – The PROD script has two variable values that we must get from the “Download attributes for API” json file. Recall that this file can be downloaded from the tool icon in your HCL Accelerate value stream. After copying and pasting the script and providing correct variable values, click “Apply” and “Save” in Jenkins.

Variable Name Description Example
VSM_ENV_ID_PROD An ID that uniquely identifies your value stream’s PROD environment 7a115f90-f4e5-4181-9920-78b216bb4afc
VSM_APP_NAME The HCL Accelerate pipeline application name (use “JKE App1” for the workbook, we will create this pipeline application later) JKE App1

SCRIPT

parameters([

string(name: 'buildNumber', description: 'The version of the application to deploy.')

])

node {

//Get value for VSM_ENV_ID_PROD from HCL Accelerate VSM "Download attributes from API" json file.

def VSM_ENV_ID_PROD="0e9ea7c7-ed1d-43f2-9ebf-a5ab5161d61e"

//VSM_APP_NAME must match your HCL Accelerate pipeline application name

def VSM_APP_NAME="JKE App1"




currentBuild.displayName = "${buildNumber}"

stage ("Deploy to PROD") {

step([$class: 'UploadDeployment',

//"versionExtId" can be used in place of "id" and "versionName"

id: "${currentBuild.displayName}",

versionName: "${currentBuild.displayName}",

name: "${currentBuild.displayName}",

description: 'UploadBuild Example',

tenantId: "5ade13625558f2c6688d15ce",

initiator: "admin",

//Must specify one of "appId", "appExtId", or "appName"

appName: "${VSM_APP_NAME}",

environmentName: 'PROD',

environmentId: "${VSM_ENV_ID_PROD}",

result: "${currentBuild.currentResult}".toLowerCase(),

startTime: "${currentBuild.startTimeInMillis}",

endTime: "${System.currentTimeMillis()}",

type: "Jenkins",

debug: false,

fatal: false,

])

}

}

 

1.3 Parameterize the Job

Make the pipeline job parameterized with a string parameter named “buildNumber”. Click “Apply” and “Save”.
HCL Accelerate VSM with Jenkins

2. Setup HCL Accelerate Pipeline

We will setup our PROD deployment a little differently than we setup our DEV and QA deployments. For this tutorial, we will setup an input job (previous build or deployment) that will provide a version to our pipeline. The pipeline will also include a parameterized PROD deployment that will pass the build number to the Jenkin job. We will be able to see an available input version to our pipeline and deploy this version to a PROD environment all from within HCL Accelerate, using Jenkins as the server, and observe actual server activity from within our value stream.

2.1 Configure the Input Job

2.1.1 From the pipeline, click on the “+” underneath “Input” for the application of interest (“JKE App1” in this example).

HCL Accelerate VSM with Jenkins

2.1.2 In the “Create Version” form choose “Automatically” and select the Jenkins job that is generating the build. For this tutorial, use the Build, DEV, QA Jenkins job that we previously created.

HCL Accelerate VSM with Jenkins HCL Accelerate VSM with Jenkins

2.2 Configure PROD deployment

We need to assign (map) the Jenkins job that will deploy to PROD to the HCL Accelerate pipeline environment for PROD. We also need to configure this job to use a pipeline parameter for build number.

2.2.1 From the pipeline, click on the “+” underneath “PROD” for the application of interest (“JKE App1” in this example).

HCL Accelerate VSM with Jenkins

2.2.2 Select the job we created for deploying to PROD and click “Save”.
HCL Accelerate VSM with Jenkins

2.2.3 We are going to link builds to deployments by passing the buildNumber as a parameter to a Jenkins job. Since we configured our job with parameters, we will be prompted at this point to provide them. HCL Accelerate has various version/inventory parameters on hand to support a fluid pipeline. In this case we will enter ${version.buildNumber} into the form.
HCL Accelerate VSM with Jenkins

You should now see “Not yet Run” under both “Input” and “PROD” columns. Go ahead and run the first Jenkins job (the input job) to provide new build information to HCL Accelerate. After running the input job, you should see version information.

  • Before Running Jenkins Job
    HCL Accelerate VSM with Jenkins
  • After Running Jenkins Job
    HCL Accelerate VSM with Jenkins

3. Final Stage Change to PROD

3.1 Pipeline Deployment to PROD

3.1.1 From your HCL Accelerate pipeline, click on the “Play” button for PROD.

HCL Accelerate VSM with Jenkins

3.1.2 Select the latest version and click “Deploy”. This will start the parameterized Jenkins job we created.
HCL Accelerate VSM with Jenkins

3.1.3 After the job has finished the pipeline should show “Deployment succeeded” along with a version number.
HCL Accelerate VSM with Jenkins

Going back to the value stream we should see the dot move all the way to PROD, its final stage.

HCL Accelerate VSM with Jenkins

Conclusion

This concludes our Jira, GitHub, Jenkins tutorial series. We navigated an entire value stream journey from backlog to production and used four separate tools along the way: three external tools (Jira, GitHub, and Jenkins), and HCL Accelerate itself as a deployment tool. We learned about key HCL Accelerate concepts such as the vsm.json file with its stage queries, integrations, and linkRules, as well as pipelines and deployments. From here you can go back and begin experimenting with your value stream. One good place to start is by looking at the vsm.json file stages and queries. From there you can begin to shape the value stream to match your own processes.

 

Comment wrap

Start a Conversation with Us

We’re here to help you find the right solutions and support you in achieving your business goals.

  |  September 30, 2024
Announcing the End of Support for HCL DevOps Velocity (formerly HCL Accelerate) 5.0.8 and Earlier Versions
Announcing End of Support for HCL DevOps Velocity 5.0.8 and earlier on June 30, 2025. Upgrade now to the latest version for continued support and access to the newest features!
  |  August 6, 2024
Announcing Our Latest Product Release: Enhancing Efficiency and Predictive Power with GenAI and More
HCL Velocity 2024.06 (5.0.6) is here with GenAI summaries, Risk Estimator 2.0, improved observability, value stream management enhancements, and simplified architecture. Learn more now!
  |  March 13, 2024
2023 Value Stream Management Trends: A Recap
New survey reveals challenges and trends in Value Stream Management. Learn how to improve collaboration, gain insights, and drive efficiency.