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.
Recently Published Posts
A day in the life of a TAM
I’ve been asked what a Technical Account Manager (TAM) does so I wanted to take the opportunity to illustrate it by walking through a standard day in the life. Before we can look at what a day in a life of a TAM is, I should provide some background in what is a TAM and […]
Read more →
Nikema’s Spinnaker Summit 2021 Recap
My Second Spinnaker Summit is in the Books! Last week I attended and spoke at my second Spinnaker Summit. Like last year’s summit, it was fully virtual. This time Spinnaker Summit was co-located with cdCon and took place on the Hopin platform. Last year, I spoke on a panel about Black professionals a few months […]
Read more →
Announcing General Availability of Armory Policy Engine Plugin
Armory Policy Engine provides support for automating policy compliance with Spinnaker. Policy Engine Plugin is the latest version of Policy Engine and adds support for both advanced role-based access control (RBAC) use-cases and open source Spinnaker. The release of Policy Engine Plugin comes with new documentation, including a library of example policies from across Armory’s […]
Read more →