CodePipeline conditionally skip action in pipeline without failing pipeline
Asked Answered
Z

0

8

We are working on a build once, conditionally deploy, style pipeline. In other words we have a pipeline that has the following make up, for instance:

  • Source action - S3SourceAction
  • Build & Test action - CodeBuildAction
  • Deploy to Dev action - CloudFormationCreateUpdateStackAction
  • Deploy to QA action - CloudFormationCreateUpdateStackAction
  • Post-Deploy Action - CodeBuildAction

We have multiple repositories that flow through this pipeline. Say for instance I want to:

  1. SKIP the "Deploy to QA" action based on an Environment Variable, but still continue to the "Post-Deploy" action.
  2. STOP completely, after the Deploy to Dev action but not FAIL the build.

Are either of these possible with CodePipeline / CodeBuild?

Zampino answered 19/4, 2021 at 17:24 Comment(5)
Do you mean that multiple repositories flow through the same pipeline instance, or just that you have the pipeline structure that is used by multiple repositories? Is the environment variable your talking about a run time variable or is it per instance of the pipeline?Merengue
Yes, multiple repositories run through this pipeline, and the builder step knows how to differentiate between those commits that came in on a branch vs those that came in via a merge to master/main. In the case of a branch build, we don't want to deploy, otherwise we continue down the path of deploying to dev -> qa -> prd. etc.Zampino
I just hit the same issue. I would like to skip some actions in a given stage. For example my stage would consist of action workflow A -> B, C, D -> E -> F (where B, C, D are ran in parallel) and I would like to skip C and E in some cases. I could just run a Lambda at action A to define which downstream actions should run and which should be skipped. Did you make it work?Decorum
Unfortunately no. However I have yet to put a lot of effort in this area. I intend on working on this in the coming months.Zampino
No solution yet?Afterbody

© 2022 - 2024 — McMap. All rights reserved.