HCL Launch is an incredibly extensible product thanks to our plugins, thorough REST API, and our easy-to-configure integrations. With the release of HCL Launch 7.1.1, our continuous delivery tool is even more developer and integration integration friendly because of our new Processes as Code feature and companion “Processes as Code Compiler (PACC)” utility.

PAC introduces a simple language to provide instructions to HCL Launch to create processes. This type of interface can be used by customers to integrate HCL Launch process creation in their automations. Benefits of PAC include:

  • Easy language to understand
  • Easy to onboard. One can start understanding PAC by getting existing process into PAC file format using download commands as explained below.
  • Convert PAC code into JSON and vice versa. This helps to quickly learn and use PAC files and rectify any issues that are in your coding.
  • Create processes using PAC files easily and quickly.
  • Upload and download any processes with required steps [which comes through plugins] with this interface.
  • Upload and download commands are secure so that processes cannot be downloaded or uploaded without authorized users.
  • The commands that translate PAC to JSON and vice versa do not need a password.

Getting started with PAC

  1. Install or upgrade HCL Launch server to 7.1.1.0 version.
  2. Download PAC tool from Help->Tools->Process-as-Code Compiler to any of the location on server.
  3. Extract it into a folder and start using commands such as ccap, pacc, upload-*, download-*
  4. Please note we have kept a readme.md file which can be referred for syntax of the language and usage guidelines of commands.

Converting our example JPetstore Process to the PAC format

Given our JPetstore component process created in this tutorial and shown below, let’s see what it looks like in the PAC format after converting it with the PACC utility
HCL Launch

JpetStore Web component process Design view from HCL Launch

To convert it into a PAC file, use this command:

download-component-process admin https://localhost:8443 1751e0fd-9502-e59c-4e93-9018d1ce2515 6 jpetWebProc.pac

That will look like the following:

start is
    start "Clean working directory"
end
plugin step "Clean working directory" is
    plugin "File Utils"
    command "Delete Files and Directories"
    property "baseDir" = "."
    property "includes" = "**/*"
    property "excludes" = ""
    property "followSymlinks" = "false"
    property "caseSensitive" = "true"
on success
    start "Download Artifacts"
end

plugin step "Download Artifacts" is
    plugin "UrbanCode Deploy Versioned File Storage"
    command "Download Artifacts"
    property "directoryOffset" = "."
    property "artifactSetBaseDir" = ""
    property "fileIncludePatterns" = "**/*"
    property "fileExcludePatterns" = ""
    property "syncMode" = "true"
    property "handleIncrementalVersions" = "false"
    property "fullVerification" = "true"
    property "setFileExecuteBits" = "false"
    property "verifyFileIntegrity" = "false"
    property "charset" = ""
    property "versionId" = "${p:version.id}"
    property "versionType" = "${p:version.type}"
    property "serverUrl" = "${p:server.url}"
    property "compId" = "${p:component.id}"
    property "resId" = "${p:resource.id}"
    property "envId" = "${p:environment.id}"
    property "maxMemory" = "1G"
    property "label" = ""
on success
    start "Start Tomcat"
end

plugin step "Start Tomcat" is
    plugin "Tomcat"
    command "Start Tomcat"
    property "launcherLocation" = "${p:environment/tomcat.start}"
    property "options" = ""
    property "timeout" = "60"
    property "port" = "8085"
    property "hostname" = ""
    property "catalinaBase" = ""
    property "catalinaHome" = ""
    property "javaHome" = ""
on success
    start "Undeploy Application"
end

plugin step "Undeploy Application" is
    plugin "Tomcat"
    command "Undeploy Application"
    property "tomcatManagerUrl" = "${p:environment/tomcat.manager.url}"
    property "tomcatUsername" = "tomcat2"
    property "tomcatPassword" = "****"
    property "tomcatContext" = "/${p:environment/tomcat.contextroot}"
on complete
    start "Deploy Application"
end

plugin step "Deploy Application" is
    plugin "Tomcat"
    command "Deploy Application"
    property "tomcatManagerUrl" = "${p:environment/tomcat.manager.url}"
    property "tomcatUsername" = "tomcat2"
    property "tomcatPassword" = "****"
    property "tomcatContext" = "/${p:environment/tomcat.contextroot}"
    property "warFile" = "./JPetStore.war"
    property "configFile" = ""
on success
    finish
end

To understand the required PAC code snippets of various steps, properties, step input values to use in future complex process designs, create a component process and run the command below:

download-component-process <userid> <server_url> <Component_Template_Process_Id> <testdata.pac>

Also, try the following steps to know how they are represented in PAC code and to get a better understanding of PAC.

  • Install Multiple Components
  • Uninstall Multiple Components
  • Run Operational Process for Multiple Components
  • Rollback Multiple Components
  • Run GenericProcess For each Affected Resource
  • Acquire and Release Lock
  • Set Status
  • Add Warning
  • Switch
  • Join
  • Note
  • Run Generic Process
  • Manual Application Task
  • For Each Agent
  • For Each Tag

To learn more about Process as Code in HCL Launch, read this blog post.

Comment wrap
Further Reading
hcl launch
Secure DevOps | October 28, 2020
Processes as Code in HCL Launch
One of the new features in HCL Launch 7.1.1.0 is the new “Process as Code” format that allows development teams to define and store their processes in an easily modifiable format.
hcl launch
Secure DevOps | October 27, 2020
What’s new in HCL Launch 7.1.1.0
Our continuous delivery software, HCL Launch, has new features that make it easier than ever to deploy anything, anywhere. Find out what's new in HCL Launch 7.1.1.
Secure DevOps | September 29, 2020
HCL Launch – In Love with Snapshots
Learn how Snapshots from HCL Launch can make handling deployments easier than ever.
a/icon/common/search Created with Sketch.