What is Azure Release Pipeline


Posted by jerryeml on 2021-03-20

Azure Release Pipeline is CD

Release pipelines in Azure Pipelines help your team continuously deliver software to your customers at a faster pace and with lower risk - from MS

基本上我的認知是 CD 就是 Release 他可以做到:

  • 全自動化
  • 半自動化
    • 中途可以有gates 去 query 某些status
    • 可以有approval的機制去等待

How do release pipelines work?


Azure Pipelines runs the following steps as part of every deployment:

  1. Pre-deployment approval: When a new deployment request is triggered, Azure Pipelines checks whether a pre-deployment approval is required before deploying a release to a stage. If it's required, it sends out email notifications to the appropriate approvers. (必須要有設定才會有這個機制)

  2. Queue deployment job: Azure Pipelines schedules the deployment job on an available automation agent. An agent is a piece of software that can run tasks in the deployment.

    • 這裡可以再切分成(後面會細談):
      • serverless job (agentless job)
      • agent job
      • deployment group job
  3. Agent selection: An automation agent picks up the job. The agents for release pipelines are exactly the same as the agents that run your builds in Azure Pipelines. A release pipeline can contain settings to select an appropriate agent at runtime.

    • 這裡可以再切分成(後面會細談):
      • agent pool agent
        • Self-host
        • MS-host
      • deployment group agent
        • Self-host
  4. Download artifacts: The agent downloads all the artifacts specified in that release, provided you haven't opted to skip the download. 把所需要的東西塞進agent job or deployment group job的agent中

  5. Run the deployment tasks: The agent then runs all the tasks in the deployment job to deploy the app to the target servers for a stage. 操作agent去run所定義的task

  6. Generate progress logs: The agent creates detailed logs for each step while running the deployment, and pushes these logs back to Azure Pipelines.(在release pipeline 可以看到log output)

  7. Post-deployment approval: When deployment to a stage is complete, Azure Pipelines checks if there's a post-deployment approval required for that stage. If no approval is required, or upon completion of a required approval, it proceeds to trigger deployment to the next stage.(必須要有設定才會有這個機制)

The unit in an release

Stage

1個stage可以有許多jobs

通常stage代表是一個階段
舉例來說可以是TEST/INT/STAG/PROD 或者是 RUN E2E TESTING/ DATA TRANFER / CLEAN ENV
每一個STAGE的切換都可以設定Gates OR approval 來判斷是否要繼續進行

Job

1個job可以有很多tasks

通常Job就是控制azure agent來幫你做一系列的task 可以分成

serverless job (agentless job) agent job deployment group job
通常會用來做 restful api的串接 或是 query某些azure workitem 控制azure agent 做事情的job 通常會根據不同需求而選擇不同azure agent 同樣也是控制azure agent 做事情的job 只是他是註冊成deployment group的形式
-------- 1. self-host azure agent 自己管的到且須要維護的azure agent (透過我們手動/自動安裝) 是self-host agent的一種
-------- 2. ms-host azure agent 託管的azure agent (躺在天上讓我們去使用) --------
延伸閱讀 : 
1. 比較AGENT JOB 和 DEPLOYMENT JOB的差異
2. 何謂AZURE AGENT? 它可以是怎樣的形式? 他可以做到甚麼?

Task

1個task只能做一件事

task就是azure agent要做的待辦事項 可以是:

  • az command
  • shell script
  • python
  • arm task
  • terraform
  • 幾乎是都可以support

How do I use a release pipeline?

For example

如果喜歡這篇觀念文章 請幫我多多推推喔XD
之後希望可以在寫幾篇手把手教學XDDD


#azure #azure-devops #pipeline #CICD #release







Related Posts

HTTP 常用 method

HTTP 常用 method

Lidemy HTTP Challenge 破關紀錄

Lidemy HTTP Challenge 破關紀錄

建立屬於你的 Google Map 地圖標記(一) - Google Map API 與 React

建立屬於你的 Google Map 地圖標記(一) - Google Map API 與 React


Comments