In Bitbucket Pipelines there conditional steps changesets definition
- step: condition: changesets: includePaths: - "path1/*" - "path2/*"
I'm thinking to dynamically adjust steps sequence to use negate changesets
- parallel:
- step:
name: clear cache
condition:
changesets:
includePaths:
- "path1/*"
- step: name: Lint
condition:
changesets:
includePaths:
- "path1/*"
- parallel:
- step:
name: Deploy
- step:
name: Lint
condition:
NOchangesets:
includePaths:
- "path1/*"
The logic is like
If has clear cache on selected changesets triggered
Do Lint togather
Else // no changesets trigger Lint goes to next parallel steps
Do Lint in Deployment
Hi @xicond,
changesets only supports includePaths at the moment. We have a feature request to support excludePaths which would allow you to do what you want to do:
If you'd be interested in that feature, please make sure to add your vote (by selecting the Vote for this issue link) as the number of votes helps the development team and product managers better understand the demand for new features. You are more than welcome to leave any feedback, and you can also add yourself as a watcher (by selecting the Start watching this issue link) if you'd like to get notified via email on updates.
In the meantime, you could achieve what you want by adding in includePaths of the steps in the second parallel set, patterns that match the rest of the directories and files in your repo (the ones other than path1/*).
Kind regards,
Theodora
Hi @Theodora Boudale
I already voted that feature request long time ago, but the excludePaths seems acting differently, from your explantion to use includePaths in different pattern
so actually what I expected is, if the pattern not exist then trigger the step.
so I cannot make out with different step, different pattern of includePaths
Not to exclude from the includePaths just to narrow down the includePaths
I can't think to inverted pattern, because it's too broad
CMIIW
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @xicond,
Apologies for the confusion, I think I misunderstood your requirements initially.
The inverted pattern will indeed not work for your use case, and I don't think there is a way to achieve what you want with the current features of pipelines.
What you want to achieve will be possible if the feature request for excludePaths is implemented; this way you could use excludePaths with path1/* for the steps of the second parallel set to achieve what you want.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.