Share via


jobs.deployment.strategy 정의

배포 전략을 사용하면 업데이트가 제공되는 방법을 구성할 수 있습니다.

이 정의를 참조하는 정의: jobs.deployment

구현

구현 설명
전략: runOnce 배포 전략을 한 번 실행합니다.
전략: 롤링 롤링 배포 전략.
전략: 카나리아 카나리아 배포 전략.

설명

애플리케이션 업데이트를 배포하는 경우 업데이트를 제공하는 데 사용하는 기술은 다음과 같은 것이 중요합니다.

  • 초기화를 사용합니다.
  • 업데이트를 배포합니다.
  • 업데이트된 버전으로 트래픽을 라우팅합니다.
  • 트래픽을 라우팅한 후 업데이트된 버전을 테스트합니다.
  • 오류가 발생하면 단계를 실행하여 마지막으로 알려진 정상 버전으로 복원합니다.

배포하는 동안 단계를 실행할 수 있는 수명 주기 후크를 사용하여 이를 달성합니다. 각 수명 주기 후크는 풀 특성에 따라 에이전트 작업 또는 서버 작업(또는 향후 컨테이너 또는 유효성 검사 작업)으로 확인됩니다. 기본적으로 수명 주기 후크는 배포 작업에서 지정한 풀을 상속합니다.

배포 작업은 다음을 사용합니다. $(Pipeline.Workspace) system variable.

자체 호스팅 에이전트를 사용하는 경우 작업 영역 클린 옵션을 사용하여 배포 작업 영역을 클린 수 있습니다.

  jobs:
  - deployment: deploy
    pool:
      vmImage: ubuntu-latest
      workspace:
        clean: all
    environment: staging

전략: runOnce

runOnce 배포 전략은 각 단계를 한 번 실행하여 변경 내용을 롤아웃합니다.

strategy:
  runOnce: # RunOnce Deployment strategy.
    preDeploy: # Pre deploy hook for runOnce deployment strategy.
      steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
      pool: string | pool # Pool where pre deploy steps will run.
    deploy: # Deploy hook for runOnce deployment strategy.
      steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
      pool: string | pool # Pool where deploy steps will run.
    routeTraffic: # Route traffic hook for runOnce deployment strategy.
      steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
      pool: string | pool # Pool where route traffic steps will run.
    postRouteTraffic: # Post route traffic hook for runOnce deployment strategy.
      steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
      pool: string | pool # Pool where post route traffic steps will run.
    on: # On success or failure hook for runOnce deployment strategy.
      failure: # Runs on failure of any step.
        steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
        pool: string | pool # Pool where post on failure steps will run.
      success: # Runs on success of all of the steps.
        steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
        pool: string | pool # Pool where on success steps will run.

속성

runOncejobs.deployment.strategy.runOnce.
RunOnce 배포 전략.

설명

runOnce 는 모든 수명 주기 후크( 즉 preDeploydeploy, , routeTrafficpostRouteTraffic)가 한 번 실행되는 가장 간단한 배포 전략입니다. 그런 다음, on: success 또는 on: failure가 실행됩니다.

전략: 롤링

롤링 배포는 이전 버전의 애플리케이션 인스턴스를 각 반복의 고정된 가상 머신 집합(롤링 집합)에 있는 새 버전의 애플리케이션 인스턴스로 바꿉니다.

strategy:
  rolling: # Rolling Deployment strategy.
    maxParallel: string # Maximum number of jobs running in parallel.
    preDeploy: # Pre deploy hook for rolling deployment strategy.
      steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
      pool: string | pool # Pool where pre deploy steps will run.
    deploy: # Deploy hook for rolling deployment strategy.
      steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
      pool: string | pool # Pool where deploy steps will run.
    routeTraffic: # Route traffic hook for rolling deployment strategy.
      steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
      pool: string | pool # Pool where route traffic steps will run.
    postRouteTraffic: # Post route traffic hook for rolling deployment strategy.
      steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
      pool: string | pool # Pool where post route traffic steps will run.
    on: # On success or failure hook for rolling deployment strategy.
      failure: # Runs on failure of any step.
        steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
        pool: string | pool # Pool where post on failure steps will run.
      success: # Runs on success of all of the steps.
        steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
        pool: string | pool # Pool where on success steps will run.

속성

rollingjobs.deployment.strategy.rolling.
롤링 배포 전략.

전략: 카나리아

카나리아 배포 전략은 서버의 작은 하위 집합에 대한 변경 내용을 롤아웃합니다.

strategy:
  canary: # Canary Deployment strategy.
    increments: [ string ] # Maximum batch size for deployment.
    preDeploy: # Pre deploy hook for canary deployment strategy.
      steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
      pool: string | pool # Pool where pre deploy steps will run.
    deploy: # Deploy hook for canary deployment strategy.
      steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
      pool: string | pool # Pool where deploy steps will run.
    routeTraffic: # Route traffic hook for canary deployment strategy.
      steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
      pool: string | pool # Pool where route traffic steps will run.
    postRouteTraffic: # Post route traffic hook for canary deployment strategy.
      steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
      pool: string | pool # Pool where post route traffic steps will run.
    on: # On success or failure hook for canary deployment strategy.
      failure: # Runs on failure of any step.
        steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
        pool: string | pool # Pool where post on failure steps will run.
      success: # Runs on success of all of the steps.
        steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
        pool: string | pool # Pool where on success steps will run.

속성

canaryjobs.deployment.strategy.canary.
카나리아 배포 전략.

설명

카나리아 배포 전략은 새 버전의 애플리케이션을 배포하는 데 관련된 위험을 완화하는 데 도움이 되는 고급 배포 전략입니다. 이 전략을 사용하면 먼저 서버의 작은 하위 집합에 변경 내용을 롤아웃할 수 있습니다. 새 버전에 자신감이 생기면 인프라의 더 많은 서버로 릴리스하고 더 많은 트래픽을 해당 버전으로 라우팅할 수 있습니다.

추가 정보