Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Specify conditionals against scripts in pipeline?

gerardlynch-vmdb April 24, 2018

Hi

I'd like to do something like this

pipelines:
default:
- step:
name: docker build
script:
- cmd: docker build . -t foo

- cmd: docker tag foo foo:$BITBUCKET_TAG
when_tag: *

- cmd: docker login ...

- cmd: docker push foo:$BITBUCKET_TAG
when_tag: *

- cmd: docker push foo:latest
when_branch: master

services:
- docker
caches:
- docker

At present it seems like I have to literally duplicate my steps in the tag or branch sections

pipelines:
default:
- step:
name: docker build
script:
- docker build . -t foo
services:
- docker
caches:
- docker

tags:
*:
- step:
...
branches:
master:
- step:
...

which is annoying, as it means that in the event of a tag on the master branch it's doubling up.

 

I also can't seem to do a subset of stuff in 'default', because it's not guaranteed to run before the 'branches/master' stuff will.

 

Any help appreciated!

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events