次の方法で共有


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、およびアンダースコアです。 deploy という単語はキーワードであり、展開名としてサポートされていません。

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

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

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

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

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

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

variables 変数
デプロイ固有の変数を します。

プールpoolします。
このジョブを実行するプールを します。

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

jobs.deployment.strategystrategyします。
このデプロイの実行戦略です。

ワークスペースworkspaceします。
エージェントの [ワークスペース] オプションを します。

クリーン オプションを含むワークスペースの詳細については、「ジョブワークスペース」トピックを参照してください。

jobs.job.usesusesします。
チェックアウト ステップやリポジトリ リソースなど、パイプライン内の他の場所でまだ参照されていない、このジョブで必要なリソースを指定します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