Spinnaker Training Series #5: Pipeline Stages

Jan 3, 2018 by Armory

Ethan Rogers, resident Spinnaker expert, demonstrates an introduction to creating different types of pipeline stages.

A Transcript of the video is available below:

Ethan: What’s up guys, I am Ethan your Spinnaker expert. Thanks for joining us for another instalment of our Spinnaker training series where we take you through Spinnaker and teach you how to get the most out of it. Today we are going to be talking about how to use the different stages within Spinnaker, to model the deployment workflows that you need rather than feeling constrained. So what we are going to do is use a whole bunch of different stages to show you how you can build a pipeline very easily that goes from build all the way to production with some various checks thrown in there, let’s get started.
So the first thing you might see in a typical deployment pipeline is Bake stage. A Bake stage is going to take some artifact produced in your CI environment bake that into an AMI, so let’s start with that. We will select a bake stage from our dropdown. Now the next thing we might typically do is take that AMI and deploy it into a test environment, so we use the add stage button again and select the deploy stage. Here we will rename the deploy stage to Deploy test so that we know which environment we are intending to stage for. Now something I have typically seen is the need to have some type of approval that says this next step of my pipeline can proceed, I can go from test to staging. Spinnaker provides us a really great way to do that using the manual judgment stage. So we will add one of those here. So the manual judgment stage gives us a lot of options, we can prompt a user for some input for example, so we will do that by saying “are you ready?” in this instruction box and then we will give the user two options. We will say yes and then we will say no. We will use these options later in our pipeline to determine where we are going like what branch we might take. We will do that now by adding a check pre-condition stage. We will select add stage again checking a pre-condition. So this gets into a part of Spinnaker that we haven’t covered yet and that is expressions. You can check out the documentation of Armory’s website about expressions at docs.armory.io. So what expressions give us is the ability to dynamically check some value within our pipeline and then we can make judgments on that.
So what we will do here is we will add a new pre-condition and we will say we want to use an expression and we will check the manual judgment stages that we just added. If you look at the documentation you will find there is a bunch of helpers here, and we are going to use one of those helpers called the judgment helper. Then will say judgment, the name of our stage equals yes. Now, if this stage passes then if these are put in yes for the manual judgment they will proceed on further down our pipeline. If it didn’t, then we will just stop the pipeline, not failing the pipeline specifically but halting it. So the next thing we will do here is we will model some type of promotion which will allow us to deploy to a different environment. So we will use another deploy stage and call that Deploy Staging. Now when you are build or your deployment finally hits a staging environment you may want to use Jenkins to run some type of acceptance testing.
We can do that by jumping back into check pre-conditions adding a parallel stage by just clicking add stage while we are sitting all in that stage and we will select the Jenkins job. You can see here that now we are running two stages in parallel. Once both of those are successfully completed, we will add one more stage that will let us deploy to production and here we will add another dependency for our up string stages that says the two previous that this stage depend on have to successfully complete before we can do this. So we will add the deploy stage here as a dependency and we can see that we have then said deployed production depends on these two. I hope that this video was helpful to you in understanding how you can use all the different stage in the Spinnaker to model your deployment workflow. Spinnaker gives us all of these really robust things that have been battle tested at some of the biggest names in our industry. You can use all of these deployment stages to do very simple deployments and very complex deployments and you can see that in this example here where we branched out and reached out into other systems specifically to do work that spinnaker doesn’t expose to us natively. I hope this video was helpful, thanks for watching.

Share this post:

Recently Published Posts

Navigating AWS Deployment Targets with Armory

Jan 20, 2023

Many organizations look to Amazon Web Services (AWS) to host and deploy their applications in the cloud. However, they’re finding that their deployment tooling, often built as an extension of their legacy continuous integration (CI), is one of the main impediments to adopting cloud services.  Custom-scripted production pipelines built with in-house tooling need to be […]

Read more

Release Roundup – January 2023

Jan 11, 2023

Get the latest product news on Continuous Deployment-as-a-Service and the most recent release for Continuous Deployment Self Hosted, 2.28.2. Welcome to 2023!  Just like every organization, Armory is looking for ways to improve our practices and deliver more value (and faster!) to you, our customers. That’s why our engineering team is working to deliver features, […]

Read more

Learn Continuous Deployment with Armory and Wilco

Jan 6, 2023

Armory is excited to announce we have launched an interactive, narrative-driven developer experience that teaches continuous deployment concepts. And now you can try it out for yourself! Wilco, also known as the “flight simulator” for software developers, allows companies to create engaging interactive developer challenges (called quests) that enable developers to acquire and practice skills […]

Read more