次の方法で共有


jobs.job 定義

ジョブは、エージェントによって、またはサーバー上で実行されるステップのコレクションです。

jobs:
- job: string # Required as first property. ID of the job.
  displayName: string # Human-readable name for the job.
  dependsOn: string | [ string ] # Any jobs which must complete before this one.
  condition: string # Evaluate this condition expression to determine whether to run this job.
  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 ] # Job-specific variables.
  strategy: strategy # Execution strategy for this job.
  pool: string | pool # Pool where this job will run.
  container: string | container # Container resource name.
  services: # Container resources to run as a service container.
    string: string # Name/value pairs
  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.
  steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
  templateContext: # Job related information passed from a pipeline when extending a template.
jobs:
- job: string # Required as first property. ID of the job.
  displayName: string # Human-readable name for the job.
  dependsOn: string | [ string ] # Any jobs which must complete before this one.
  condition: string # Evaluate this condition expression to determine whether to run this job.
  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 ] # Job-specific variables.
  strategy: strategy # Execution strategy for this job.
  pool: string | pool # Pool where this job will run.
  container: string | container # Container resource name.
  services: # Container resources to run as a service container.
    string: string # Name/value pairs
  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.
  steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
jobs:
- job: string # Required as first property. ID of the job.
  displayName: string # Human-readable name for the job.
  dependsOn: string | [ string ] # Any jobs which must complete before this one.
  condition: string # Evaluate this condition expression to determine whether to run this job.
  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 ] # Job-specific variables.
  strategy: strategy # Execution strategy for this job.
  pool: string | pool # Pool where this job will run.
  container: string | container # Container resource name.
  services: # Container resources to run as a service container.
    string: string # Name/value pairs
  workspace: # Workspace options on the agent.
    clean: string # Which parts of the workspace should be scorched before fetching.
  steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
jobs:
- job: string # Required as first property. ID of the job.
  displayName: string # Human-readable name for the job.
  dependsOn: string | [ string ] # Any jobs which must complete before this one.
  condition: string # Evaluate this condition expression to determine whether to run this job.
  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 ] # Job-specific variables.
  strategy: strategy # Execution strategy for this job.
  pool: string | pool # Pool where this job will run.
  container: string | container # Container resource name.
  services: # Container resources to run as a service container.
    string: string # Name/value pairs
  workspace: # Workspace options on the agent.
    clean: string # Scorch the repo before fetching?
  steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | publish | template ] # A list of steps to run.
jobs:
- job: string # Required as first property. ID of the job.
  displayName: string # Human-readable name for the job.
  dependsOn: string | [ string ] # Any jobs which must complete before this one.
  condition: string # Evaluate this condition expression to determine whether to run this job.
  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 ] # Job-specific variables.
  strategy: strategy # Execution strategy for this job.
  pool: string | pool # Pool where this job will run.
  services: # Container resources to run as a service container.
    string: string # Name/value pairs
  workspace: # Workspace options on the agent.
    clean: string # Scorch the repo before fetching?
  steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | publish | template ] # A list of steps to run.

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

プロパティ

job 文字列。 最初のプロパティとして必須。
ジョブの ID。 使用できる値: 有効な名前には英数字と '_' のみが含まれており、数字で始まる場合はありません。

displayName 文字列。
ジョブの人間が判読できる名前。

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

condition 文字列。
この条件式を評価して、このジョブを実行するかどうかを判断します。

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

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

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

variables変数
ジョブ固有の変数。

strategyjobs.job.strategy
このジョブの実行戦略。

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

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

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

workspaceワークスペース
エージェントのワークスペース オプション。 クリーン オプションを含むワークスペースの詳細については、ジョブに関する記事でワークスペースのトピックを参照してください。

usesjobs.job.uses
まだ参照されていない、このジョブで必要なリソース。 uses について詳しくは、「ジョブの承認スコープを参照先の Azure DevOps リポジトリに制限する」をご覧ください。

steps手順を実行します
実行する手順の一覧。

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

解説

既定値は 60 分に設定されています timeoutInMinutes 。 詳細については、「 タイムアウト」を参照してください。

ジョブは条件付きで実行でき、前のジョブに依存する場合があります。

注意

1 つのステージと 1 つのジョブだけの場合は、実行するステップを記述する短い方法として単一ジョブ構文を使用できます。

jobs:
- job: MyJob
  displayName: My First Job
  continueOnError: true
  workspace:
    clean: outputs
  steps:
  - script: echo My first job

関連項目