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

How do I use a user defined variable for deployment env name

Pranjal Kesharwani March 21, 2024

Hi,

I have defined environments name in settings of a repo and my pipeline script has a user defined variable $env which I want to use like below $env is given bu user.


- step:
name: Deploy to $env
deployment: $env
runs-on:
- 'self.hosted'
- 'linux.shell'
on running above script I am getting error :
The environment '$env' in your bitbucket-pipelines.yml doesn’t match any environment defined in your settings. Either update your yml, or your settings, to use the same name.
So how to modify script here

1 answer

1 vote
Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 25, 2024

Hi @Pranjal Kesharwani,

Welcome to the community.

Unfortunately, using an environment variable as part of the step name or deployment is not currently supported by Bitbucket Cloud Pipelines.

We do have an existing feature request for it that can be located through this link. - https://jira.atlassian.com/browse/BCLOUD-13014
You can upvote and watch it for now so that you'll be notified of any updates from our team when the feature becomes available on Bitbucket Cloud.

We appreciate your patience and understanding as we continue to improve Bitbucket Cloud according to our policy on implementing new features.

Regards,
Mark C

Pranjal Kesharwani April 3, 2024

Thanks @Mark C 

Suggest an answer

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

Atlassian Community Events