AWS Step Functions: the Deployment Orchestrator that CodePipeline should have been

AWS Step Functions: the Deployment Orchestrator that CodePipeline should have been

I think your issue of “Parallel builds” is solved by creating separate branches, but you list separate branches as another problem. I know other people don’t like this pattern, or expect a different pattern from their pipeline, but I do like this. What I mean is, I like that each branch gets an entirely separate pipeline and build process. If you design around that concept, you don’t have to worry about any of the problems you mentioned.

I put the deployment in the hands of whatever developers are working on that branch. Ideally, they can deploy the entire pipeline themselves in their own dev AWS account from only the code that’s in the branch. Worst case, I have to get it set up for them, but then they’re on their own and can edit anything they want via pushes to git, right down to the pipeline itself (although I’d probably discourage that).

I do like the idea of the conditional branching you added. At the same time, I think that looks very complex and (perhaps) hard to manage. CodePipeline is straightforward steps that take place. You can also trigger a State Machine directly from CodePipeline too, if needed.

CodePipeline a complex system, but most of all it is opinionated.

I think the author is being nice. Being opinionated is not an excuse for no dynamic branch or conditional execution support. :wink:

That said, it seems to me a little bit reinventing-the-wheel to implement build pipelines using Step Functions. What’s wrong with a Jenkins or TeamCity cluster on EC2 which would support all those missing features out of the box?

+1 These are “not cloud” so we are “forced” to sell the cloud. Stupid cloud ruined the cloud.

I’m not making excuses for it not being built in, but it is rather easy to do with Lambda.

https://aws.amazon.com/blogs/devops/adding-custom-logic-to-aws-codepipeline-with-aws-lambda-and-amazon-cloudwatch-events/

Well maybe not easy. But I have done it.

What advantage does dynamic branching give you over just deploying a new pipeline when a new branch is added?

Well, how about you are charged by the number of active pipelines to boot? :slight_smile:

Not specifically to CodePipeline, the problem with one pipeline per branch is when you need to change something in the pipeline config, you’d have to change all the pipelines - think about all the feature/* and release/* branches. Sure you could have it scripted but it’ll still be pretty disruptive if your script catches a running pipeline.

Well, $1/mo per active branch is not really that much, running Jenkins would probably cost more - and yes, it is a little disruptive to change the pipeline and then merge to another branch. I rarely ever have to do that though, and most times CodePipeline handles changes fine, it just changes the pipeline and then executes again. Unless you’re making huge changes, but i wouldn’t say it’s any more work than making major changes to a build pipeline on some other platform.

Yeah, of course those are not blocking issues and people manage to find decent workaround or at least live with them. But the question is still, why? I mean, it’s something incredibly easy to support. Just make the CodeCommit source action support properties. Build actions already support them.

It actually just occurred to me that maybe this is intentional because of the pricing model. //shrug

I guess I don’t see it is a “workaround” or “living with something” or some mad scheme to scrape an extra $2/mo out of customers. Rather, I see it as working exactly as it’s designed. I can respect that you probably work with other pipeline technologies that do what you’re looking for.

Having separate pipelines per branch allow me to incorporate all the code needed to deploy the entire app as one set of scripts and a single template. Each branch can be independently deployed, pipeline and all, with no information from any other branch or some central pipeline.

With your design, you would have a central pipeline that manages all the environments. That pipeline would be a completely separate item to manage and would probably live completely separately from the git repo itself.

Both are valid methods, I just want to point out to you that CodePipeline does work exactly as it’s designed to work, it’s just generally a different deployment strategy than people are used to with tools like Jenkins.

There are a lot of customer requests for something more similar to what you are talking about though. I have a feeling you’d be happier with the new Proton service.