July 18, 2018

Harness Template Library For Continuous Delivery

Table of Contents

Key takeaway

Taking scripts away from a DevOps engineer is a bit like taking expenses away from a sales rep; Defcon 1 is just around the corner.

At Harness, we're trying to simplify Continuous Delivery so that developers and DevOps teams spend more time writing software than writing deployment scripts. To achieve this, we have a concept called "Smart Automation" that helps teams stitch together their ecosystem of tools, artifacts, run-times, and clouds so that deployment pipelines take minutes to build.

Think of Harness as Continuous Delivery-as-a-Service where our platform delivers 95% of what you need out-of-the-box, and gives you the flexibility to script the last mile.

We shipped a new capability last week called "Template Library" that allows customers to templatize, index, and share their favorite commands/scripts, thus enabling reuse across teams and deployment pipelines.

Sharing is Caring

At its core, DevOps is about collaboration. Sharing knowledge, experience, code, success, and failure is a force multiplier. No longer can any businesses rely on one or two Jedis to save the day. Jedi tricks must be shared and reused if the Force is to remain strong. This means tribal knowledge and magic must be codified, reused, and promoted across all teams so everyone benefits.

Harness Template Library

Our new template library allows customers to codify and categorize their favorite HTTP requests, BASH, and Powershell scripts--all of which can be linked and instantiated inside Harness deployment workflows and pipelines.

Here's a quick 2-minute video of the feature:

Example - Deployment Marker For New Relic

Using a simple HTTP webhook, we can mark Harness deployments as events inside New Relic (and other APM/Log tools) so that users are contextually aware of deployments when they analyze New Relic performance data.

Better still, we can templatize this HTTP webhook using the Harness Template Library so that many dev teams can link and reuse this deployment marker for their own app, services, and deployments.

Simply go to: Setup > Template Library

Template Library

Next, add Folder and call it Deployment Markers.

New Folder

Click Add Template and select HTTP.

Template Library - Add Template

Insert Your HTTP webhook attributes using New Relic's documentation. You can add automatically add Harness variables to any of this configuration data by simply using the $ prefix and clicking "add variable." In the New Relic example below, we've created two variables for application name and the New Relic API key. This means that dev teams can instantiate this webhook inside their deployment workflows and pass in their own parameters (e.g. application name, New Relic API, etc.).

Add New Relic Marker

Once created, the New Relic deployment marker will look like this:

New Relic Deployment Marker

Now, let's create a new basic deployment workflow:

Template Library - Create Basic Deployment Workflow

You can see that Harness has automatically pre-populated many of the deployment steps and configuration (infra, load balancer, deployment) using its Smart Automation. However, it also allows a user to add their own commands to any of these steps.

After step 3 (deploy service), we can go ahead and add our New Relic deployment marker by clicking Add Command.

Next, we pick our New Relic Deployment Marker Template from our library:

Add Command and Pick From Template Library

Click Link and then input your specific application and New Relic variables using $ and then select the appropriate environment variables from Harness that are being managed for you. For example, Harness allows you to set variables at the application, service, and environment level. In the case of our example below, application name and New Relic API KEY would be application level variables.

Add Key

Now our deployment workflow looks like this:

Deployment Workflow With Help From Template Library

Harness will now install the new service artifact and then register a new deployment event in New Relic using our HTTP template from the Template Library, and it will do so using our specific application and New Relic API key dynamically.

We can apply the same concept with any HTTP request, BASH, or Powershell script. It's almost too easy!

Sign up for your free trial of Harness today!


You might also like
No items found.

Similar Blogs

No items found.