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 environment.dev.ts and for production it will environment.prod.ts.
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 environment.dev.ts or environment.prod.ts
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 environment.prod.ts 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/environment.dev.ts
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.
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...
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