I'm wondering if there is a way to do:
```yaml
Hello @Paul Helter ,
Thank you for reaching out to Atlassian Community!
I'm afraid that at this moment it's not possible to define environment variables at step level. We already have a feature request to implement that functionality, though :
I would suggest you to add your vote there, since this helps both developers and product managers to understand the interest. Also, make sure you add yourself as a watcher in case you want to receive first-hand updates from that ticket. Please note that all features are implemented with this policy in mind.
While this feature is not implemented, a workaround-ishy way of having different values for the same variable is to define different deployment environments , create the deployment variables in each deployment environment, and then assign a different deployment to each step, like the below example :
pipelines:
default:
- step:
name: Deploy to Test
deployment: env1
script:
- echo $DEPLOYMENT_VARIABLE
- step:
name: Deploy to Test
deployment: env2
script:
- echo $DEPLOYMENT_VARIABLE
So, although the environment variable name is the same, you can set different values to it for each deployment environment.
Hope that helps! Let me know if you have any questions.
Thank you, @Paul Helter .
Kind regards,
Patrik S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.