And our workflow is a bit longer than before. Now, let's untangle this. Our workflow now runs build and test in a matrix. Well, that means that bullets fly in slow motion, and it tests things in various node versions. So essentially, if you're thinking about how, like various options you can run each kind of build with, this allows you to specify all these kind of different options, and CircleCI will create you a matrix of various kind of permutations. For example, now we have node versions. It could also have some other dependencies versions, like, say browsers, exactly. Like you could have Chrome, Linux, Mac all that stuff as kind of matrix parameters and run tests across different platforms like that. We're still running dependency vulnerabilities and build docker. This time we're running all three of them in parallel, after which we have a hold for approval job, which will ask us to click whether something is, we want this to proceed, after which we have a deploy to Heroku job. So our graph is gonna look slightly different. Let's see how it's gonna look. So yeah, you can see, okay, I'm building and testing on 15, 14, and 13 running build, dependency vulnerabilities, and now I'm being asked to hold for approval basically. And basically this is like a manual step that you would introduce in an otherwise automated process where you need to actually, a human to go through set of manual checks. You need someone to go through a checklist or whatever, for whatever reason before hitting approve or deny for that matter, and then going on to proceeding with the rest of the pipeline.
Can I jump in real quick, Jean? Yeah. Yeah, so yeah, this is really important and pretty cool, right. So what Jean is showing you here is a couple things, right? Obviously we've introduced, we've streamlined our YAML config to use orbs, which is great because it encapsulates functionality, makes your YAML a lot easier to read, and it gives you the ability to implement things, tools and other services from other partners and the community and CircleCI. One of the things I wanna mention though is, when you're, Dierck can you go back to your dashboard? Yeah. When you're building things like, for testing purposes, you can do like these regression tests on previous builds, which is really, really cool. And you don't have to write a lot of code to do it. It's just literally just saying, hey, run this job in a matrix and then do all of these things. And then finally, we have shown you like the manual process. So I'm sure we all work in places where like, we have a boss or a team, that's like, hey, don't do anything until I look at it. Code reviews, that's where this approved manual approval step is really, really useful. And we see that a lot. At least I see that a lot with teams is like right before code review, before it gets released into maybe a major or a main production branch trunk branch or something like that, this, you know, this workflow process will help with that, right, and enable the people who need to approve things, give them the ability to do that. I generally don't like the approve button, but it's a very useful feature, but I don't like to use them in my pipelines as I like my stuff just to go, you know, automatically, but you have to be very confident as well in the pipelines. And I'll just leave it at that. These are very important kind of issues or features that Jean's showing you how to be more resilient and efficient with your pipelines. Yep, yep, yep, yep, thank you, Angel. Okay, so let's go and untangle these things. First, let's look at how to build things on various platforms at the same time. I mentioned that we're using this matrix keyword which allows us to pass a set of different parameters which can be like anything here. And parameters is another circle CI keyword that is then passed to that job. And matrix basically means for all the different permutations of, or actually combinations of whatever, and this is run that many jobs of that type. Parameters you actually define at the top of your job or within your job. And there are essentially ways to kind of add a bit more dynamism to your builds. For example, I've introduced this thing called node version, which is a type of string with a default value. So I'm passing in a default value so you don't have to kinda always use it. And then in my docker image, which before was just node 15.4, I'm actually passing in whatever that value from parameters is. And the syntax for that is two smaller than and two larger than signs And within those you put in parameters.node version. There is, there is a whole page for these kinda reusable config. Angel, do you mind pasting that page in for that? Because like parameters are like super big topic. I've even made a video about them. Oh yeah, the parameters. You wrote the blog post about them. Yeah, I can post that stuff, sure. No problem. Yeah, that's like a bunch of that. And the rest of the job is exactly the same. It's just like the Docker is kinda picking its own, the docker image, it's picking that value, or version value from these parameters, which are then passed from this matrix of options. If you can think of any other kinda thing that you might want to change in your tests, you can actually do through this matrix. And if you have another parameter, that would be like a lot more jobs run in the same time. We mentioned the hold for approval job, which essentially is a job of any name that has a type of approval. And that will tell CircleCI that's actually an approval job. It doesn't need to be defined elsewhere because it's got a type approval. And to just specify everything else like requires. One more cool thing we have in this approval job is this filters keyword, which basically lets you say, I'm only interested in running this part of the workflow whenever something happens. In our case, that's only on the main branch. Only in the main branch, we want to actually go through this approval and ultimately deploy to Heroku. Sorry. I was going to say Angel Arena, his son, this is actually for Peter, I think he was asking about this earlier. So this is how you would set up filters, right, to say one way you could do it is by in a single workflow, create multiple filters, right, to execute a certain way or execute on a certain condition, which could be a branch name and then you could build different workflows, right, with those filters. So you could have three workflows and maybe you only want one to kick off per branch, right? So if you have a main, which is production, staging, or QA, right, all of those things. So you can filter out and they will only run, you can either say filter, like to execute, yes, or filter, never execute, right, or only execute is what I'm trying to say. So yeah, look up into those things, it should be, look into the filtering processes, and it's a simple Regex, it's nothing too wild. Someone asked if Orb is basically a plugin for CI, CD. It's not, it's a circles, it's like a packaged version of circles CI config, shareable across projects. That's an Orb, so it's just more YAML.
Comments