Bitbucket Pipelines steps to always perform (setup step) Edited

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

 

 

2 answers

1 accepted

This widget could not be displayed.

There is already an issue for this here: https://bitbucket.org/site/master/issues/12751/allow-more-capable-steps-that-can-be

Closing this post

This widget could not be displayed.

This seems to be a part of a bigger issue of allowing multiple steps and it is still an open issue

This is no longer open @Jad Baz

Why is this no longer open ?  As long as I know this requirement is not available in any form neither any workaround

What Danielo said. As far as I can see, what Jad asks for is not resolved yet?

You're right, I unmarked answer as correct.

So this is still an open issue as far as I can see

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Friday in Bitbucket

What is your #1 piece of advice to new users getting started using Bitbucket?

Hello Community! My name is Claire Maynard, and I’m a Product Marketing Manager on the Bitbucket team. I’m interested in hearing what advice or tips you have for new users getting started on ...

136 views 5 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you