I am implementing a gitflow workflow with master and development branches, and I have 3 environments: DEV, UAT, PROD.
Using Azure DevOps, when the PR completes and the feature branch is merged into development, I trigger the release to DEV environment.
I am unsure on how to deploy to UAT after that. My first approach was to automate the deployment to UAT after the deployment to DEV succeeded (sequentially, DEV and then UAT), but it doesn't feel right to automate the deployment to UAT.
Should I create another branch for UAT deployments, and automate the deployment to UAT when development merges into that branch?
It's not need to have a branch for each environment. You should promote the artifact, not the source code. A specific branch should be integrated with the CI process, and its artifact should be promoted through each stage until production. The Continuous Delivery pipeline should reflect the environment stages, not the branch model.
A useful blog for your reference:
https://medium.com/#grazibonizi/understading-the-connection-between-branching-models-and-delivery-pipeline-c9cb12e30516
Related
According to Microsoft. ADF will create the adf_publish branch that contain the ARM template. If I have 3 environment: DEV, UAT and PROD. And 2 items of work: A and B. Both of them are developed in DEV and merged to master and published afterward.
From adf_publish I will then deploy the UAT for testing purposes. What if item A is passed the UAT, B is not and I only want to deploy item A into next PROD release. Do I have to create another branch from DEV to eliminate B, merge to master and re-deploy to DEV/UAT/PROD again? Please view this
Context.
In case of Azure data factory, release pipeline will take ARM templates from adf_publish branch and then deploy them directly in to different environments. ARM templates will be generated in adf_publish branch when you actually publish changes to DEV ADF after your PR.
Hence, it will good if you can plan to execute test cases of UAT also on feature branches itself so that any specific branch related changes of passing your test case then you can avoid PR for that specific branch.
I have a project with two branches (develop and master) and a release process to three environments (dev, staging, production).
I've implemented CI/CD, where the code on develop branch is the code deployed to dev and staging environments. The last step of my release pipeline is deploy to production and I would like to know if there's a way (a task) to check if the code deployed on dev and staging environment is already on master branch.
Thanks
In this case i would suggest you separate dev deployment from the rest, otherwise you will never know if your merge to master was succesful or not, since you never test it. In my opinion the master branch in your case should be the mirror on what is in production.
for your dev build, create a release pipeline which deploys to your dev environment
create another build for the master branch trigered When you merge your dev branch into master. You can use tagging and set a new tag on master, before merging, in order to preserve the old version for hotfixing. and then:
either a new release pipeline with stages staging and Prod
or a new artifact in the previous pipeline with artifact filters for the stages staging and prod
You could also consider changing your branching strategy. In case you develop features and only merge them to your branch, which is deployed to Prod in the end stage, you could use Release Flow branching model with only 1 branch.
The last step of my release pipeline is deploy to production and I
would like to know if there's a way (a task) to check if the code
deployed on dev and staging environment is already on master branch.
For now we don't have any task which is designed to do this kind of job. So there doesn't exist one easy solution to your requirements, you may have to do some changes to your workflow to meet your requirements. Just as the Mario suggests above, you can consider using the Release Flow.
I am setting a CI/CD pipeline on Azure devops.
This one gets executed when a Build for the master branch is completed.
I was asked to set the stages of the image above, which description is the next one:
Development, QA and Production : Publish the build artifacts on a server (each one).
Testing: Execute some automated test with katalon studio.
My problem is that, when I create a Development branch this pipeline cannot be executed for the build, because the pipeline is just executed when I commit to the master branch, then I create another CI/CD pipeline for Development branch, remove Development stage from Master CI/CD pipeline and incorporate it in this new pipeline.
My question is... is that correct ? , what´s the best estrategy for git branching when you have this kind of pipelines?
My problem is that, when I create a Development branch this pipeline
cannot be executed for the build, because the pipeline is just
executed when I commit to the master branch, then I create another
CI/CD pipeline for Development branch
For this issue, you don't need to do that. You only need to add the Development branch to the Branch filters of Continuous Integration in build Triggers.
Then add the Development branch to the Build branch filters of the Continuous deployment trigger.
After this setting, when you commit to development branch, build and release pipeline will also be triggered.
Heroku and Gitlab have Preview Apps as part of their CI/CD pipeline. Which is great for trunk based development as you get to test the branch in an isolated environment before merging the PR to master. Is there a way to do this in Azure DevOps? Could you use a custom Agent for this? How would you do that?
Our stack has React (client), .NET Core (api), MS SQL Server (storage). What I would like to add to our CI/CD pipeline is Preview App which can be used as QA step and we could also run our E2E Cypress tests against it.
Currently our devs have to run E2E tests locally as part of our PR process. For QA step we have to merge the PR to the master so that it will get deployed to our development server. Since QA works against our master branch we are forced to use release branches. After QA approves the merged PR, it's then cherry-picked to release branch. Release branches are then build and deployed automatically.
I would like to add QA step to our PR process so that we could deploy straight from master. Now we get it done, but I would like to streamline the process even more.
Using the Delivery Pipeline service, I'd like to deploy my artifacts to staging/QA environments where QA/Product team members can test features/defect fixes before those changes get merged into Production branch.
How would I spin up these temporary testing environments when pull requests are created?
There is currently no way to build off of pull requests. One option would be to have a separate branch that people can merge code into. You can then have a build stage which builds that branch and a deploy stage to deploy to your staging/qa environment. You can then have another stage will does the merge into the production branch. (Note, this stage should only be triggered manually.)