Add 'circleci step skip-build' command
T
Tymensteur
Current support
Currently it's possible to stop a job once it's started based on some conditions/logic within a step by calling
circleci step halt
. The job will stop and it's marked as successful. It's very useful to be able to to this so you can properly terminate a job based on some (complex) conditions. The build is 'successful' however, so following jobs in a workflow will be executed.Request
It would be great to be able to tell CircleCI to fully skip a build from a job step. Marking it as 'skipped' in the CircleCI UI and thus ignoring any other following builds or jobs in the workflows.
Proposal
Add a command to tell CircleCI to fully skip the current build. I propose
circleci step skip-build
(similar to the existing circleci step halt
).- steps: - run: circleci step skip-build
This causes:
... the current job to stop (not executing any following steps).
... to not start any following jobs or workflows for this build.
... to finish other parallel jobs for this build, but any following jobs won't be started.
... mark the build as 'skipped' for the CircleCI UI.
CCI-I-262
S
Shachar Or
Hi Timothy Clarke - I think that the current dynamic workflow solution does not apply to all cases.
For instance - let's say that my workflow is very distributed to many computational jobs. At the beginning of each job I want to quickly check if the execution is needed or not (imagine 40 jobs, to do this for each job in the setup workflow job sequentially is a bad idea).
T
Timothy Clarke
Take a look at Dynamic Configs to generate workflows that different steps https://discuss.circleci.com/t/intro-to-dynamic-config-via-setup-workflows/39868
A
Andreas Bucksteeg
Completely agree with the comment above. I am currently working on some helper to make monorepos work smoothly with CircleCI and was looking for exactly a way to skip everything from this current point of execution ("the branch").
S
Steven Harman
How different is this proposal from canceling a job?
Z
Zoltán Szepesi
I agree, but I think it shouldn't skip the whole build just the "branch" so any build that has the job as a dependency should be skipped too. This would be useful for monorepos when you skip the unmodified parts so no testing, building or deploying will be done.