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:
Join us June 26, 11am PT for a webinar with Atlassian Champion Robert Hean & Loom’s Brittany Soinski. Hear tips, stories, and get your burning questions answered. Learn how Loom makes training and enablement easier. Don’t miss it!
Register todayOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.