Pipeline as code

During the past few years there has been a rise of interest in infrastructure-as-a-code. In my opinion, the rise of cloud computing was one of the biggest motivations and enablers behind infrastructure-as-a-code. Cloud computing was also an enabler for microservices. A typical microservice architecture requires many deployment pipelines which are for the most part identical. And this is a new challenge for many teams to deal with. Other emerging challenges are around version controlling and backing up build and deployment pipelines. From my experience and observation, cloning a build or deployment pipeline through CI/CD tool (if supported at all), and backing up the build machine are the most common answers to address above challenges. While these techniques may help to address some of the concerns, but they are not perfect and scalable. You might be able to clone pipelines as many times as you want manually through your CI/CD tools, but can you apply a change across all the pipelines in one go? If you need to manually change each pipeline to accommodate new changes, then you are in trouble. If you have no history or version control around pipeline changes then you better to pay your DevOps engineer well and make sure he is not leaving your company! Do you backup your build machine after any change into the pipeline? Do you health check your backups? What do you do if you don’t have access to a build machine? These should be enough to prove you need a better and easier way to maintain your pipeline specially when it comes to microservices, enterprise application and scalability. The answer is simple – Pipeline as Code; Similar to Infrastructure-as-a-Code concept. Pipelines as code is defining the build and deployment pipelines through code instead of configuring a running CI/CD tool. So now, if someone forks or clone your repo, they can get your pipeline definition as well as your code. Jenkins, Azure DevOps,  LambdaCD, GoCD and Drone are some of the major players when it comes to pipeline as code. Microsoft introduced build pipeline as code for Azure DevOps in Nov 2017; However, release pipeline still in progress and not fully supported at this stage. If you are not doing pipeline as code, I believe you need to start doing it from today and version control all the changes.

If you want to know A – Z about Jenkins pipeline, I recommend you to watch this training.

2 thoughts on “Pipeline as code”

  1. Although I wasn’t familiar with the concept, I enjoyed it. Currently, we are using a docekrized CI/CD which works perfectly depending on our infrastructure and team skills; Despite the fact that I didn’t see any pipeline as code to date, I guess it would be suitable for companies with more than 80 – 100 developers, I admit that the developer counts is not a good approach in this case, and it is better to consider too many aspects, but generally, I believe we should keep it simple, when you grow (in project itself, and team size), you should improve many aspects including CI/CD.
    Thank you for sharing this amazing approach with us

    Like

    1. Thanks Nasser, I personally recommend everyone and any team at any size to code pipeline. One of the main benefits is when someone clone or fork your repository, he can pull down your pipeline and code together. If you are using Azure DevOps, you can export your current build definition as code and go from there. I do agree with you on keep it simple when you are small, but pipeline as code doesn’t make much difference really. Thanks.

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.