CI/CD Meets Orchestration: Cloudify & Jenkins

Isaac
3 min readJul 23, 2020

Programmatic access to Cloudify Manager is available through an official REST API. The two other access methods — namely, the CLI and the UI — both use the same official REST API.

When working with Jenkins, automating Cloudify-related tasks becomes a challenge. Interacting with Cloudify would require placing curl commands in “Execute Shell” build steps or pipeline steps, tedious error-prone code for parsing results and so forth.

The Jenkins plugin for Cloudify comes to address these issues, significantly reducing the effort required to create and maintain Jenkins artifacts (jobs and pipelines) that use Cloudify.

Prerequisites

The Cloudify Jenkins plugin declares its prerequisites in standard Jenkins plugin fashion, so installing the plugin will result in all prerequisite Jenkins components being downloaded and installed automatically.

The Jenkins plugin requires Cloudify Manager 5.0.5 or later. Both Community and Premium editions are supported.

Configuration

The Jenkins plugin configuration is simple, and currently (as of July 2020) consists of the IP/host name of Cloudify Manager and the default tenant name. All Cloudify-related steps will refer to the same Cloudify Manager.

Plugin Configuration

(There are plans to support multiple Cloudify Managers in a later release)

Authentication

Authentication to Cloudify is performed using a username & password combination. Therefore, the plugin uses the Jenkins built-in “Username with password” credentials type.

Adding Credentials for Cloudify

Almost all build steps provided by the plugin require the ID of a Jenkins credentials entry.

Credentials in Jenkins can be system-scoped or user-scoped. The Cloudify Jenkins plugin supports both.

Build-Steps

The Cloudify Jenkins plugin provides a set of build-steps that implement discrete, well-defined Cloudify functionality. These build-steps can be mixed and matched to fit within any job or pipeline, and are designed to not be dependent on each other.

Adding a Build Step

The plugin provides build-steps for various popular Cloudify operations, such as:

  • Uploading a blueprint
  • Creating a deployment
  • Executing workflows
  • Deleting a deployment
  • Deleting a blueprint
  • Uploading a plugin

(Over time, and with accordance to customers’ requirements, additional build-steps are expected to be added.)

All build-steps provided by the plugin are fully compatible with the standard Pipeline syntax. For example, the createCloudifyEnv mnemonic represents the “Create Cloudify Environment” build step.

Logging

All provided build-steps that interact with Cloudify Manager use the standard Jenkins logging facilities. Build-steps that result in workflows being executed on Cloudify Manager redirect the Cloudify execution logs into the standard Jenkins log.

These principles relieve Jenkins users from the need to log into Cloudify for the purpose of retrieving logs, simplifying tracking and easing troubleshooting efforts.

Integration with Orchestrators and Provisioners

A powerful feature of the Cloudify Jenkins plugin consists of build-steps that delegate to other orchestration and provisioning tools. Currently, the following are supported:

  • Kubernetes
  • Azure ARM
  • Terraform
  • Ansible
  • AWS CloudFormation

For example, the “Create Azure ARM Deployment” step receives an Azure ARM template, along with associated parameters, and creates an Azure deployment based on that template.

Similarly, the “Apply Terraform Module” step receives a Terraform module, along with associated parameters, and runs that module.

Build-Step for Applying Terraform Module

The only prerequisites for these integrations are corresponding plugins being installed on Cloudify Manager, such as the Azure plugin (for ARM templates) and the Terraform plugin (for Terraform modules). The Jenkins plugin takes care of the heavy-lifting for you.

Links

--

--

Isaac

Traveller, writer, musician, software architect; not necessarily in that order