Suppose I have the following bitbucket-pipelines.yml
pipelines:
default:
- step:
script:
- chmod +x gradlew
- ./gradlew build
- ./gradlew publishSnapshot
tags:
release-*:
- step:
script:
- chmod +x gradlew
- ./gradlew build
- ./gradlew publishRelease
So bitbucket pipelines' documentation says that the default step is run every time no other rule is matched (such as branch or tag).
So for example, if I have a tag release-* rule:
- When I don't have a tag, the default step will run
- When I have a "release-vX.X.X" tag, the release-* step will run
The problem is that the bold lines are shared code and therefore redundant.
Is it possible to have a kind of setup step that will run before all?
This is an example of what I mean:
pipelines:
setup:
- step:
script:
- chmod +x gradlew
- ./gradlew build default:
- step:
script:
- ./gradlew publishSnapshot
tags:
release-*:
- step:
script:
- ./gradlew publishRelease