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?
@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.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.