Here are things I want to do with Bitbucket pipelines:
This is my scenario, now my question is that how can we set the env variable dynamically on each step without creating a new build?
Or is there any way to set the env variable in the Bitbucket site and access in code dynamically so I can manage through that.
Else create a new build for each environment is the last option for me.
I would suggest using deployment environment variables, which are intended for just this.
Deployment variables override both team and repository variables. Also variables with the same name can have different values for each deployment environment. For example, you could set a different $DEPLOYMENT_SECRET_KEY for each environment.
name: Build Site
- echo $SOME_TOKEN # repo value for testing, etc
name: Staging Deployment
- echo $SOME_TOKEN # statging specific value
name: Switch to Live Deployment
- echo $SOME_TOKEN # different value
Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events