Hey guys ,
I have the following branches
a) development
b) stage
c) production
I have written bitbucket pipeline for all the above 3 branches to do build and deployment to respective machines (dev vm ,stage vm , prod vm) . So, the pipeline code is same, just the final deployment happens on 3 vms . Now , i have 3 pipelines.yml residing in all 3 branches and is working fine .
But the issue is if i do a code merge thro pull request from dev to stage , even my pipelines.yml will be merged . How to avoid this problem . Should i write the pipelines.yml outside of these branches ? If yes, where i need to put that ? in master ?
Thanks
Hi there! Thanks for reaching out to the Atlassian community.
I would recommend that all 3 branches should use the very same pipelines.yml file so that merging is not an issue.
Then to specify which machines each environment should deploy to, you can take advantage of Bitbucket deployments. You can configure environment-specific deployment variables such that each environment gets a different value. Your deployment scripts can use these variables for anything which varies between environments. That way they can all share the same pipelines.yml, but just use variables to specify options.
Hope this gets you started. You can read more about deployments and variables at these links:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.