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

Should variables be defined in the pipe.yml of a custom Bitbucket Pipe?

oobug September 28, 2022

I've noticed that some of the standard Bitbucket Pipes define some or all of the variables for the pipe within their pipe.yml file. Searching the project shows that (as of today) 14 of the 53 repositories in the Bitbucket Pipelines Pipes project have defined variables in the pipe.yml file.

However, the pipe.yml specification in the Write a pipe for Bitbucket Pipelines article does not provide any documentation for the "variables:" keyword, its specification, or its function.

Is there a reason to declare variables in the pipe.yml of a Bitbucket Pipe? What does this accomplish? Is there functionality made available by declaring variables in the pipe.yml that is not available through merely consuming provided variables in the main script of the pipe? Is this a deprecated feature?

 

EDIT: A coworker pointed out a blog post from December 2019 that discusses this feature as a way of implementing default variables. However, this feature does not appear to be documented in any of the official documentation. Is this intentional?

1 answer

1 accepted

0 votes
Answer accepted
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 30, 2022

@oobug  hi. Thanks for question.

 

We will update this page.

Answering to your question, you can provide or not default variables in pipe.yml, it's up to you.

Example  with variables:

name: My demo pipe
...
variables:
- name: ENV_NAME
default: 'Production'
- name: SECRET_KEY
default: '${SECRET_KEY}'
...

 

Regards, Igor.

oobug September 30, 2022

To confirm, does that Updates to Bitbucket Pipes blog post accurately describe the functionality of declaring variables in the pipe.yml? That is, it's for the purpose of declaring default values for variables in the pipe?

Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 3, 2022

yes

Like oobug likes this

Suggest an answer

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

Atlassian Community Events