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: string # Which parts of the workspace should be scorched before fetching.
  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: string # Which parts of the workspace should be scorched before fetching.
  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: string # Which parts of the workspace should be scorched before fetching.
  container: string | container # Container resource name.
  services: # Container resources to run as a service container.
    string: string # Name/value pairs

この定義を参照する定義: jobs

プロパティ

deployment 文字列。 最初のプロパティとして必須。
デプロイ ジョブの名前、A から Z、a から z、0 から 9、アンダースコア。 deploy という単語はキーワード (keyword)であり、展開名としてサポートされていません。

displayName 文字列。
デプロイの人間が判読できる名前。

dependsOn string |文字列リスト。
このジョブの前に完了する必要があるジョブ。

condition 文字列。
この条件式を評価して、このデプロイを実行するかどうかを判断します。

continueOnError 文字列。
障害が発生しても実行を続けますか?

timeoutInMinutes 文字列。
サーバーによって強制終了されるまで、このジョブが完了するまで待機する時間。

cancelTimeoutInMinutes 文字列。
ジョブを強制的に終了する前に、ジョブが取り消されるのを待つ時間。

variables変数
デプロイ固有の変数。

poolプール
このジョブが実行されるプール。

environmentjobs.deployment.environment
デプロイ履歴を記録するターゲット環境名と必要に応じてリソース名。format: environment-name.resource-name。

strategyjobs.deployment.strategy
このデプロイの実行戦略。

workspaceワークスペース
エージェントのワークスペース オプション。

usesjobs.job.uses
まだ参照されていない、このジョブで必要なリソース。

containerjobs.job.container
コンテナー リソース名。

services 文字列ディクショナリ。
サービス コンテナーとして実行するコンテナー リソース。

templateContext templateContext。
テンプレートを拡張するときにパイプラインから渡されるデプロイ関連情報。 詳細については、「解説」を参照してください。 の詳細については templateContext、「 拡張 YAML パイプライン テンプレートをステージ、ジョブ、デプロイのコンテキスト情報に渡す」とテンプレート - templateContext を使用してプロパティをテンプレートに渡す」を参照してください。

解説

YAML パイプラインでは、パイプライン チームはデプロイ ジョブにデプロイステップを配置することをお勧めします。

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