We are using Blue Green deployments with one master branch and decide which cluster we want to deploy to using user input selection in the pipeline.
This is prone to user errors, since the user can by mistake select Blue cluster instead of Green. What is the standard way to implement this?
Is it a good practice to create a Blue Release Branch and a Green Release Branch and configure pipelines for each release branch ?
Related
How is image promotion handled with 'dev' images?
Like many others, we have three environments for deployments – Dev, Stage, Production.
Stage always tracks the latest master, and production deploys are triggered when releases are tagged in Github. It's easy enough to promote images between stage and production.
Where I'm having trouble understanding this is with Dev. Dev images are built on pull requests in our case, but there's a good chance the branch behind the PR is some number of commits behind master, so promoting this image through the ranks would cause outdated code to end up on stage and prod.
What is the typical practice here? Are dev images kept separate, in a separate image repository and never mixed with the stage/production images? Is there some way to promote them that I'm missing?
Stage always tracks the latest master, and production deploys are triggered when releases are tagged in Github
Dev images are built on pull requests in our case, but there's a good chance the branch behind the PR is some number of commits behind master
This is all a bit confusing to me. I like to keep things simple, and I usually advocate for one branch per environment.
In this scenario, I would advise you to have the following branches:
dev
stage
production
This will allow you to make changes to one environment at a time, progressively. So first you would push your changes to the dev branch, and if they are successful, you would then push the same changes to staging; likewise, if the changes are successful in staging, you would then push the changes to production. The pushing to the branch can and should be done via merge requests.
Each branch would have its own pipeline associated to it, which would build, test and release the image to the environment specific registry. Keeping registries separate amongst environments may seem overkill but it would make your life easier when it comes down to permissions management.
Having one branch per environment also has the added benefit that you will be able to restrict access to certain branches, e.g. everyone should be able to merge to dev but not everyone should be able to merge to prod.
We are using Sonarqube 8.0 and TFS together with gated checkins. So when I check in a version of the code that makes the quality gate red, we break the build and the checkin gets rejected. But if I check in the exact same code again, sonarqube only analyses the new code and therefore the gate is green again, as there is no difference to the last analysis, which was red. So we where thinking to make the "New Code Period" the last green analysis, but this does not seem possible. I can only choose "Previous" "Periods of days" and "Specific". To me this does not make all too much sense, as I only want to see what is changing to my current checkin. Maybe we have to analyse the master branch and only set the analysis to check versus a specific version of the master branch, but that seems like a lot of work to always select a new version when we merge to master.
I know the analysis works better with pull requests to master from private projects, but we do not have git here, so this is no option right now.
Is there a good way to keep our dev branches clean with sonarqube? Right now it feels a little useless in combination with TFS and a single DEV branch…
To clarify, what I'm looking for is a Build from latest commit rather than Build from current commit.
I don't see a Build (from latest commit) button in Blue Ocean. I've got to be missing something, right?!
In Classic View you have "Schedule a Scan for pipeline" so, if you've just pushed something to git you can Rebuild.
However, in Blue Ocean you just have the Replay button (which just runs the last commit it has already pulled down).
How do you force Blue Ocean to pull the latest commit?!
When you view the last build for a certain branch, there is a "reload" style button on the upper right side. This allows you to run a build again:
In the Activity screen, the same button is also visible:
Currently, there is no rebuild option in blueocean see here
I'm using Blue Ocean against Bitbucket Server. I want a new build to occur:
When a Pull Request is created or updated
When master is updated (basically, when a PR is merged to master)
It appears that I can do the first by choosing "Discover Branches: Only branches that are also filed as PR's". I can do the second by choosing "Filter by name: master".
But if I specify both, it seems to apply the name filter to discovered branches, so no PR's are ever discovered. Furthermore, it never builds master because master is never the subject of a PR (we have master locked against direct commits, as is common in enterprise development.)
I figured it out but it was not intuitive. You must add two BitBucket Branch Sources, both pointing to the same Repository. The first must be the Filter by Name: Master. The second must be "Discover Branches: Only branches that are also filed as PR's". If they're in the opposite order, they won't work.
Within Bamboo I have several linked repositories. Each one of these repositories are connected to a specific branch, which you have to set through Bamboo's web interface. Is it possible to dynamically choose the branch without having to go in and change the linked repo branch every single time?
Yep, Bamboo supports branches, both manually added and automatically detected without new repository needing to be created. You just need to let it know where you keep branches in your repo.
https://confluence.atlassian.com/bamboo/using-plan-branches-289276872.html
Scroll down to managing plan branches in bamboo. They reference feature branching at the top of this article, but you don't have to be using that paradigm to get some use out of the branching support in bamboo.