デプロイ ジョブ は、特殊な種類のジョブです。 これは、環境に対して順番に実行する手順のコレクションです。
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.environmentを environment
します。
ターゲット環境名と、必要に応じてデプロイ履歴を記録するリソース名。format: environment-name.resource-name。
jobs.deployment.strategyを strategy
します。
このデプロイの実行戦略です。
ワークスペースを workspace
します。
エージェントの [ワークスペース] オプションを します。
jobs.job.usesを uses
します。
チェックアウト ステップやリポジトリ リソースなど、パイプライン内の他の場所でまだ参照されていない、このジョブで必要なリソースを指定します。
uses
の詳細については、「リソースを事前に宣言するためのジョブ承認スコープと "uses" ステートメントを制限する」を参照してください。
jobs.job.containerを container
します。
コンテナー リソース名を します。
文字列ディクショナリ 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