Introducing The Harness Template Library For Continuous Delivery

Everyone has their own favorite commands and scripts. With the Harness Template Library, you can index, manage, and share them across all your dev teams and deployment pipelines.

By Steve Burton
July 18, 2018

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. Jedis 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”

folder

Click “Add Template” and select HTTP

Add HTTP

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, …).

Add New Relic Marker

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

Deployment Marker

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

New 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:

Pick Marker

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.

Variables

Now our deployment workflow looks like this:

workflow

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!

Cheers,
Steve.

@BurtonSays

 

➞ Back to Blog

Leave a Reply

avatar
  Subscribe  
Notify of