다음을 통해 공유


jobs.deployment 정의

배포 작업은 특수한 유형의 작업입니다. 환경에 대해 순차적으로 실행하는 단계의 컬렉션입니다.

jobs:
- deployment: string # Required as first property. Name of the deployment job, A-Z, a-z, 0-9, and underscore. The word deploy is a keyword and is unsupported as the deployment name.
  displayName: string # Human-readable name for the deployment.
  dependsOn: string | [ string ] # Any jobs which must complete before this one.
  condition: string # Evaluate this condition expression to determine whether to run this deployment.
  continueOnError: string # Continue running even on failure?
  timeoutInMinutes: string # Time to wait for this job to complete before the server kills it.
  cancelTimeoutInMinutes: string # Time to wait for the job to cancel before forcibly terminating it.
  variables: variables | [ variable ] # Deployment-specific variables.
  pool: string | pool # Pool where this job will run.
  environment: string | environment # Target environment name and optionally a resource name to record the deployment history; format: environment-name.resource-name.
  strategy: strategy # Execution strategy for this deployment.
  workspace: # Workspace options on the agent.
    clean: outputs | resources | all # What to clean up before the job runs.
  uses: # Any resources required by this job that are not already referenced.
    repositories: [ string ] # Repository references.
    pools: [ string ] # Pool references.
  container: string | container # Container resource name.
  services: # Container resources to run as a service container.
    string: string # Name/value pairs
  templateContext: # Deployment related information passed from a pipeline when extending a template.
jobs:
- deployment: string # Required as first property. Name of the deployment job, A-Z, a-z, 0-9, and underscore. The word deploy is a keyword and is unsupported as the deployment name.
  displayName: string # Human-readable name for the deployment.
  dependsOn: string | [ string ] # Any jobs which must complete before this one.
  condition: string # Evaluate this condition expression to determine whether to run this deployment.
  continueOnError: string # Continue running even on failure?
  timeoutInMinutes: string # Time to wait for this job to complete before the server kills it.
  cancelTimeoutInMinutes: string # Time to wait for the job to cancel before forcibly terminating it.
  variables: variables | [ variable ] # Deployment-specific variables.
  pool: string | pool # Pool where this job will run.
  environment: string | environment # Target environment name and optionally a resource name to record the deployment history; format: environment-name.resource-name.
  strategy: strategy # Execution strategy for this deployment.
  workspace: # Workspace options on the agent.
    clean: outputs | resources | all # What to clean up before the job runs.
  uses: # Any resources required by this job that are not already referenced.
    repositories: [ string ] # Repository references.
    pools: [ string ] # Pool references.
  container: string | container # Container resource name.
  services: # Container resources to run as a service container.
    string: string # Name/value pairs
jobs:
- deployment: string # Required as first property. Name of the deployment job, A-Z, a-z, 0-9, and underscore. The word deploy is a keyword and is unsupported as the deployment name.
  displayName: string # Human-readable name for the deployment.
  dependsOn: string | [ string ] # Any jobs which must complete before this one.
  condition: string # Evaluate this condition expression to determine whether to run this deployment.
  continueOnError: string # Continue running even on failure?
  timeoutInMinutes: string # Time to wait for this job to complete before the server kills it.
  cancelTimeoutInMinutes: string # Time to wait for the job to cancel before forcibly terminating it.
  variables: variables | [ variable ] # Deployment-specific variables.
  pool: string | pool # Pool where this job will run.
  environment: string | environment # Target environment name and optionally a resource name to record the deployment history; format: environment-name.resource-name.
  strategy: strategy # Execution strategy for this deployment.
  workspace: # Workspace options on the agent.
    clean: outputs | resources | all # What to clean up before the job runs.
  container: string | container # Container resource name.
  services: # Container resources to run as a service container.
    string: string # Name/value pairs

이 정의를 참조하는 정의: 작업

속성

deployment 문자열입니다. 첫 번째 속성으로 필요합니다.
배포 작업의 이름, A-Z, a-z, 0-9 및 밑줄입니다. 배포라는 단어는 키워드이며 배포 이름으로 지원되지 않습니다.

displayName 문자열입니다.
배포에 대한 사람이 읽을 수 있는 이름입니다.

dependsOn string | 문자열 목록입니다.
이 작업 전에 완료해야 하는 모든 작업입니다.

condition 문자열입니다.
이 조건 식을 평가하여 이 배포를 실행할지 여부를 결정합니다.

continueOnError 문자열입니다.
실패하더라도 계속 실행하시겠습니까?

timeoutInMinutes 문자열입니다.
서버가 이 작업을 종료하기 전에 이 작업이 완료되기를 기다리는 시간입니다.

cancelTimeoutInMinutes 문자열입니다.
강제로 종료하기 전에 작업이 취소되기를 기다리는 시간입니다.

변수variables.
배포 관련 변수입니다.

pool .
이 작업이 실행되는 풀입니다.

environment jobs.deployment.environment입니다.
대상 환경 이름 및 필요에 따라 배포 기록을 기록할 리소스 이름을 . format: environment-name.resource-name.

strategy jobs.deployment.strategy.
이 배포에 대한 실행 전략입니다.

작업 영역workspace.
에이전트의 작업 영역 옵션을 .

정리 옵션을 비롯한 작업 영역에 대한 자세한 내용은 작업작업 영역 항목을 참조하세요.

uses jobs.job.uses입니다.
체크 아웃 단계 또는 리포지토리 리소스와 같이 파이프라인의 다른 위치에서 아직 참조되지 않은 이 작업에 필요한 리소스를 지정합니다. 자세한 내용은 미리 선언된 리소스에 대한 uses작업 권한 부여 범위 제한 및 "uses" 문을 참조하세요.

jobs.job.containercontainer.
컨테이너 리소스 이름입니다.

문자열 사전을 services.
컨테이너 리소스를 서비스 컨테이너로 실행할 .

templateContext templateContext입니다.
템플릿을 확장할 때 파이프라인에서 전달된 배포 관련 정보입니다. 자세한 내용은 비고를 참조하세요. 자세한 templateContext내용은 확장 YAML 파이프라인 템플릿을 단계, 작업 및 배포 및 템플릿에 대한 컨텍스트 정보를 전달할 수 있습니다 . templateContext를 사용하여 템플릿에 속성을 전달합니다.

비고

YAML 파이프라인에서 파이프라인 팀은 배포 단계를 배포 작업에 배치하는 것이 좋습니다.

자세한 templateContext내용은 확장 YAML 파이프라인 템플릿을 단계, 작업 및 배포 및 템플릿에 대한 컨텍스트 정보를 전달할 수 있습니다 . templateContext를 사용하여 템플릿에 속성을 전달합니다.

예시

jobs:
  # track deployments on the environment
- deployment: DeployWeb
  displayName: deploy Web App
  pool:
    vmImage: ubuntu-latest
  # creates an environment if it doesn't exist
  environment: 'smarthotel-dev'
  strategy:
    # default deployment strategy, more coming...
    runOnce:
      deploy:
        steps:
        - script: echo my first deployment