Product
|
Cloud costs
|
released
January 9, 2020
|
3
min read
|

Solving Standardization in Continuous Delivery

Updated

Taking a note out of the platform engineering discipline, having solid platforms in place to further engineering efficiency certainly pays dividends. Developing software requires a lot of trial and error and having platforms in place to support the trial in error is crucial. Submitting builds and artifacts through your pipelines multiple times before we get the features right is common as we go through the SDLC. Though going through the ebbs and flows to build the pipelines we submit our applications to e.g to integrate, test, and deploy distributed applications can be painful.A bulk share if not all the clients and prospects we partner with at Harness face challenges around standardization of pipelines. Clearly, one size does not fit all applications but where the challenge is to maintain innovation velocity while still having guardrails/incentives to avoid anti-patterns. At Harness, we are purpose-built to solve that very problem.

Smart Clients and (not) Dumb Pipes

Depending on which microservice manifesto you take a look at, a common theme is “smart clients and dumb pipes”. This concept moving logic towards publishing or consuming endpoints. In the messaging world, leveraging a lightweight protocol to send many messages and have the receiver/consumer aka a client decipher what to do with the messages.The same should not be said for your Continuous Delivery pipelines. In the older guard, our modern and distributed applications were depending on dumb pipes [think a Jenkins pipeline] to turn your ideas into the applications we deploy today. To create the smart pipelines needed would require a hodgepodge of plug-ins and lengthy orchestration scripts like your “beloved” Jenkins environment.Today’s modern and robust distributed applications require in a similar fashion infrastructure that is robust and easy to leverage to turn your ideas into the applications we deploy today.

Imagine Building a New Home

A few years ago I moved into a new construction. The neighborhood was completely new and standing on the freshly paved roads where the soon to be homes you notice lots of sewer pipes sticking out of the ground.Every lot had one of these sewer pipes. Though as time goes on unique homes are placed on each lot and the sewer pipes are hidden as they are integrated into the homes. The home builder doesn’t get value from the sewer pipes but the homes they build. Though without the sewer pipes, the homes would be inhabitable.Similar to the applications that are front and center of many enterprises today, the piping does not bring much value by itself but the applications like the homes are where the creative and value adds are. With the Harness Platform, your teams can easily self-service to create pipelines that meet your enterprise standards today and in the future.

Your First Standardized Pipeline

There are a few paths to start to standardize your pipelines in the Harness Platform. Modern platforms need to allow you to maintain innovation while allowing opinions and guardrails to be in place for business controls. Finding an effective way to do this is the proverbial challenge most if not all software engineering teams face. With a combination of Pipeline Governance, Templates, and Configuration as Code, you and your organization will be well on the way to solve the proverbial pipeline challenge.

Harness Continuous Delivery Platform

 

Pipeline Governance

We recently introduced Pipeline Governance into the Harness Platform. Pipeline Governance can be summed up as a way to measure against conformance. We have a pretty detailed blog post on the art of the possible with Pipeline Governance.To take a quick spin in Pipeline Governance, head to Continuous Security -> Governance.

Then click on +Add Governance Standard. Can make a conformance standard to apply on your Harness Pipelines. Create a Pipeline Governance Standard called “Golden Canary Standard”.

Adding a rule will allow us to score the conformance. For example, let’s say we want to do some sort of conformance test, for example, if our application scales. We can add the Name “Scale App”.

Once you click Submit, the standard will show up on the list.

When you return to the Governance Screen, you can move the toggle to on to enable.

Once you have your Pipeline Governance enabled, the next step would be to wire to a Harness Pipeline. Can navigate to a Harness Application. In the Harness Workflow, you can leverage Harness Tags to correlate information across Harness. Since our trusty Pivotal Cloud Foundry Workflow [from our PCF Blog] has a scale/resize step, add a Tag of “Scale App”.

After the workflow creation, add a Harness Pipeline named “Golden Pipeline” if you do not already have a pipeline. Setup -> Applications -> Pipelines + Add Pipeline.

Once you hit submit, add a Pipeline Stage by clicking +.

Add a Pipeline Stage, call the Step Name “First” and select your Workflow you want to execute.

Once you hit Submit, the bottom will display the Pipeline Governance rules available to the Pipeline. Since we did not restrict the Pipeline Governance, will be available to all of our Pipelines. Here we are conformant with our standard. Glorious!

Conformance to standards is one pillar that the Harness Platform helps achieve. Where the rubber meets the road, you can also templatize tasks that Harness preforms.

Templates

An oldie but a goodie, Templates are a hallmark of the Harness Platform. In our professional version, you might see a few seeded in your Template Library already.Can see what you have available by navigating to Setup -> Template Library

Revisiting our blog post on Templates, wiring and leveraging a Template is pretty straight forward.You can see how easy a Template is to wire by creating a quick Shell Script as a Template. In the +Add Template drop-down, select Shell Script.

As an example, let’s echo out our name [leaving your stamp on a Pipeline is important duh!].Name the Template "Simple Template".

echo "Hello my name is ${name}"At the bottom, add a Variable called “name” so you can input a name.

Once you click Submit, the Template will be available for use.

Now you can add the Template into your Workflow. Leveraging the PCF Application, to leave our mark on the app let’s echo our name in a Shell Script.In a Workflow, add a command under one of the first sections, in PCF_Perfection’s Basic PCF Workflow case is under “1. Setup” + Add Command

In the Add Command box, select “Select from Shared Template Library”. Your “Simple Template” should be there.

Click Link on Simple Template.

Then click Submit. Now your “Simple Template” is part of the execution steps.

Once you execute the Workflow, you can see your step executed.

That was a pretty simple example. There is a lot of art of the possible with Templates. Let’s took a look at a GitOps focused way next with Harness’s Configuration as Code.

Configuration as Code

Lastly, you can wire up a Git-based Synch with Harness as Configuration as Code. Digging into our Pivotal Cloud Foundry Blog’s Tree, can setup Git Sync.The easiest way to see this in action is to use a service like GitHub.The first step is to wire your GitHub Repository to Harness by going to Setup -> Connectors -> Source Repo Providers +Add Source Report Provider.

Enter the details of your GitHub Repository. Make sure to check Generate Webhook URL.

Your Webhook URL will be generated in a dialog box that you can copy or head back to your configuration to view. You will eventually need the Webhook URL to wire into your GitHub Repository.

Time to set up the Harness Tree as Configuration as Code. Navigate to Setup -> Configuration as Code.

Select the ellipses to set up Git Sync on the Harness Tree.

Enable Git Sync using the Git Connector you just set up. In my case, I do not have a Branch so just using master.

Once you hit submit can validate that artifacts are now in your GitHub Repository.

Can add individual Applications to by navigating on the Harness Tree to an Application and clicking on the Git Icon for example next to PCF_Perfection.

Click on the Git Icon and set up Git Sync on the Application.

Once you hit Submit, the Sync icon will appear.

To wire the Webhook for Harness to be notified of events, head to your GitHub Account and select Repository -> Settings

Webhooks -> Add Webhooks

Paste in WebHook URL from Harness as Payload URL. Make sure to change the content type to application/json.

Where the magic is, If you would like to create another Harness Environment, for example, can Git Clone the Environment once you give the new Environment a different name. GitHub has a desktop client you can use if you are GUI inclined like myself. Can Clone your repository to get started. My private example repo is called “captaincanary”.

Once Cloned this UI will appear.

Can copy and paste an Environment in your file explorer e.g Finder. Copy and paste Staging.

Paste in and give a new name such as “Performance”

You can Commit the changes back to the Branch, in my case master.

Next click Push origin.

Your Performance Environment will now be there in GitHub.

Also reflected in the Harness Tree.

If you browse to an Application structure that had the Environment, your new Performance Environment is there.

You can also go for gold and copy an entire Harness Application in a similar fashion if you would like to clone an Application. In your file explorer e.g Finder, copy the entire “PCF_Perfection” folder.

Paste with a new name, for example PCF_Prowess.

Commit changes in Git.

Push origin.

Ta-da! PCF Prowess is there in GitHub and the Harness Tree and UI under Settings -> Applications.

Also in the Harness UI.

The method of Cloning can be very useful if there are Harness Assets that need to be shared across the organization. At Harness, we are here to help solve the challenges with you.

Harness, Solving The Challenges With You

With any platform that providers engineering efficiency getting the radio dials right between innovation and policy is a difficult one to navigate. With the Harness Platform and the expertise that Harness provides, getting the radio dials right is simple. If getting the radio dials right in engineering efficiency is important to you / your organization, look no further than Harness and sign up today.Cheers!-Ravi

Sign up now

Sign up for our free plan, start building and deploying with Harness, take your software delivery to the next level.

Get a demo

Sign up for a free 14 day trial and take your software development to the next level

Documentation

Learn intelligent software delivery at your own pace. Step-by-step tutorials, videos, and reference docs to help you deliver customer happiness.

Case studies

Learn intelligent software delivery at your own pace. Step-by-step tutorials, videos, and reference docs to help you deliver customer happiness.

We want to hear from you

Enjoyed reading this blog post or have questions or feedback?
Share your thoughts by creating a new topic in the Harness community forum.

Sign up for our monthly newsletter

Subscribe to our newsletter to receive the latest Harness content in your inbox every month.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Continuous Delivery & GitOps