jobs.deployment definition

A deployment job is a special type of job. It's a collection of steps to run sequentially against the environment.

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 # Deployment-specific variables
  pool: pool # Pool where this job will run
  environment: deploymentEnvironment # Target environment name and optionally a resource name to record the deployment history; format: environment-name.resource-name.
  strategy: deploymentStrategy # Execution strategy for this deployment
  workspace:  # Workspace options on the agent.
    clean: string # Which parts of the workspace should be scorched before fetching.  (outputs, resources, all)
  container: jobContainer # Container resource name
  services:  # Container resources to run as a service container.
    string: string # Name/value pairs.

Properties that use this definition: jobs

Properties

deployment

string

Required as first parameter. 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 or string list

Any jobs which must complete before this one.

condition

string

Evaluate this condition expression to determine whether to run this deployment.

continueOnError

boolean

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

Deployment-specific variables.

pool

pool

Pool where this job will run.

environment

jobs.deployment.environment

Target environment name and optionally a resource name to record the deployment history; format: environment-name.resource-name.

strategy

jobs.deployment.strategy

Execution strategy for this deployment.

workspace

workspace options

Workspace options on the agent.

container

jobs.job.container

Container resource name.

services

string name/value pairs

Container resources to run as a service container.

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 # Deployment-specific variables
  pool: pool # Pool where this job will run
  environment: deploymentEnvironment # Target environment name and optionally a resource name to record the deployment history; format: environment-name.resource-name.
  strategy: deploymentStrategy # Execution strategy for this deployment
  workspace:  # Workspace options on the agent.
    clean: string # Which parts of the workspace should be scorched before fetching.  (outputs, resources, all)
  uses:  # Any resources required by this job that are not already referenced
    repositories: [ string ] # Repository references 
    pools: [ string ] # Pool references 
  container: jobContainer # Container resource name
  services:  # Container resources to run as a service container.
    string: string # Name/value pairs.

Properties that use this definition: jobs

Properties

deployment

string

Required as first parameter. 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 or string list

Any jobs which must complete before this one.

condition

string

Evaluate this condition expression to determine whether to run this deployment.

continueOnError

boolean

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

Deployment-specific variables.

pool

pool

Pool where this job will run.

environment

jobs.deployment.environment

Target environment name and optionally a resource name to record the deployment history; format: environment-name.resource-name.

strategy

jobs.deployment.strategy

Execution strategy for this deployment.

workspace

workspace options

Workspace options on the agent.

uses

pools and repositories

Any resources required by this job that are not already referenced.

container

jobs.job.container

Container resource name.

services

string name/value pairs

Container resources to run as a service container.

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 # Deployment-specific variables
  pool: pool # Pool where this job will run
  environment: deploymentEnvironment # Target environment name and optionally a resource name to record the deployment history; format: environment-name.resource-name.
  strategy: deploymentStrategy # Execution strategy for this deployment
  workspace:  # Workspace options on the agent.
    clean: string # Which parts of the workspace should be scorched before fetching.  (outputs, resources, all)
  uses:  # Any resources required by this job that are not already referenced
    repositories: [ string ] # Repository references 
    pools: [ string ] # Pool references 
  container: jobContainer # 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. See remarks for more information.

Properties that use this definition: jobs

Properties

deployment

string

Required as first parameter. 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 or string list

Any jobs which must complete before this one.

condition

string

Evaluate this condition expression to determine whether to run this deployment.

continueOnError

boolean

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

Deployment-specific variables.

pool

pool

Pool where this job will run.

environment

jobs.deployment.environment

Target environment name and optionally a resource name to record the deployment history; format: environment-name.resource-name.

strategy

jobs.deployment.strategy

Execution strategy for this deployment.

workspace

workspace options

Workspace options on the agent.

uses

pools and repositories

Any resources required by this job that are not already referenced.

container

jobs.job.container

Container resource name.

services

string name/value pairs

Container resources to run as a service container.

templateContext

templateContext

Deployment related information passed from a pipeline when extending a template. See remarks for more information.

Remarks

In YAML pipelines, we recommend that you put your deployment steps in a deployment job.

Examples

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