Continuous Delivery & Deployment Post/Pre Approval In Working

 

When we discuss multi-stage deployment in that location, we may develop some pre- and post-deployment strategies. post-condition.

 

  • Approvers
    • Some Approvers to approve your release before it goes to that environment.
  • Gates
    • If you want to have a time duration, a gap between your deployment, then at that time you will add gates.
    • Gate feature controls the overall workflow of your deployment pipeline.
    • Now imagine between two environments Dev and QA, the dev got deployed Successfully but before things goes in QA. 
      • You want to set up some environment
      • You want to run some automated script.
      • You need to create some environment before your deployment starts in QA.
    • So in between the deployment, if you want to have some sort of pause, A deployment pause in between so that you can carry out some other tasks. In such cases you will be using gates.
  • Intervals
    • As per the continuous delivery the lower environment will get deployed directly without any manual intervention. But when it comes to the upper environment stage and prod, you will have some sort of manual interventions.
    • It could be any valid reason like 
      • You are running some sort of automated test in your lower environment. 
      • You are waiting for the confirmation, 
      • You are running some sort of integration testing, 
      • You are following some release cycle that during this release period only you will be deploying into the upper environment.
  • Pre/Post Condition
    • Each stage can be configured with pre post condition like manual approval, checking for specific condition, etc..
    • Pause the deployment pipeline workflow and carry out manual tasks like health checks etc.. 
    • This is where you can use gates.

 

 

 

Integrate Pre/Post Conditions in our Pipeline

Till now we run our release pipe line manually, lets make this auto

 

Let change this manual trigger to Continuous Deployment Trigger (Auto)

  • Click Edit Pipeline
    • Click Continuous Deployment trigger icon
    • Enable Continuous deployment
    • Now when this build gets successful then automatically a release will be created.

 


Add Pre Condition above

  • The deployment will not start unless and until you have a precondition.
  • Click Pre condition table prior to Dev button
    • Now Pre deployment condition  has 2 types of triggers
      • Manual Only
        • Even though if the release got created, you have to come and click on the deploy button manually.
      • After Release
        • if the build is successful, the release is created, your deployment will start running.
  • Line between 2 tasks represent continuous delivery
    • It will not show if select Manual only

 

  • if we selected after release we can also select multiple conditions as pre checks below
    • Lets add approvals and gates
      • Approvals
      • Gates
        • Add Delay
        • Add some auto task like run azure function etc
          • By clicking add button
      • Deployment queue settings
        • Use this if you want to do a parallel deployments

 

 

 

Add Post Condition above

  • Click Post Deployment condition 
    • Rest all are same as in pre conditions. 
    • auto redeploy trigger. This is for in case of stage failure. In case your deployment fails. It will go back and take the previous working version and redeploy that for you.

 


Check By Running this pipeline

After some time it ask  for approval. pre Stage we added

  • Click Approve to approve deployment

 

After approval our approval Gates start working

 

After one minute of delay (as mentioned in Gate), it continue to deploy

deployed

 

 

And finally deployed after some seconds

 

 

Test by running your App service URL

devops-core-app-e4bhfpbqgxhkbacr.canadacentral-01.azurewebsites.net

 

 


Related Question