Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Bitbucket Pipelines Templating DRY Not working

Janis Orlovs
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 6, 2022

Hello,

I want to use bitbucket DRY feature with yaml anchors. 

    branches:
master:
- step: *build

definitions:
steps:
- step: &build
image: openjdk:11.0-jdk-buster
name: Build and test vol di
script:
- date +%Y-%m-%d_%H%M > bld_date
artifacts:
- bld_date

I get:

 

Screenshot 2022-01-06 at 15.36.41.png

 

What I am doing wrong?

1 answer

0 votes
Norbert Csupka
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 7, 2022

Hi Janis,

Thank you for contacting Atlassian Community. My name is Norbert and I'm a Bitbucket Cloud Support Engineer, it's nice to meet you! Welcome to the Atlassian Community :)

Based on my observation, you have the "definition" part after the "pipelines" part. Can I ask you to move the "definition" part above the "pipelines" part and let me know if that makes any difference, please?

Pipelines need to know the "definition" part first, before it can initiate the "pipelines" part, I suspect that's the reason why it's failing. In case it's still not working, can I ask you to share the your bitbucket-pipelines.yml file with us masking all the private/confidential information so that I can review your configuration?

I'm looking forward to hear from you.

Best Regards,
Norbert
Atlassian Bitbucket Cloud Support

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events