Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to use bit bitbucket's variables in Angular environment in CI/CD?

I am using angular 8 and want to use CI/CD. till now I am storing secret key in environment file. for development I have created and for production it will

While I am using CI/CD so I am thinking that instead storing it in environment file store it in bitbucket variables. and while deploying the variable can be changed. 


I know if created variable SECRETKEY in bitbucket pipeline then I can use it like $SECRETKEY  in package.json.  can I use this in same way in any where in angular. like in or

2 answers

let say if you want to read the BITBUCKET_BUILD_NUMBER from bit bucket in your angular application, it can be achieved in two simple steps.

1. Add the following line of code in your file


2. In your .yml file add the following line under the scripts

 - sed -i -e 's%$BITBUCKET_BUILD_NUMBER%'"$BITBUCKET_BUILD_NUMBER"'%g' ./src/environments/ 
0 votes
Ana Retamal Atlassian Team Aug 12, 2019

Hi there!

Seems like your questions is geared towards Angular's usage and not towards any of our Atlassian products. I'm afraid in that case we won't be able to help you, as this Community is centered around Atlassian and the members here might not be familiar with Angular. I encourage you to post your question in a different forum dedicated to that technology.

If I misunderstood your question and you were indeed referring to one of our products, please let us know so we can continue helping you.



Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

⭐ Calling all Bitbucket and DevOps experts: Special showcase opportunity ⭐

Hi, Bitbucket community! Are you a DevOps practitioner (or know one in your network)? Do you have DevOps tips, tricks, or learnings you'd like to share with the community? If so, we'd love to hea...

1,479 views 4 7
Read article

Community Events

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

Events near you