definition av jobs.deployment
Ett distributionsjobb är en särskild typ av jobb. Det är en samling steg för att köra sekventiellt mot miljön.
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
Definitioner som refererar till den här definitionen: jobb
Egenskaper
deployment
Sträng. Krävs som första egenskap.
Namn på distributionsjobbet, A-Z, a-z, 0–9 och understreck. Ordet deploy är ett nyckelord och stöds inte som distributionsnamn.
displayName
Sträng.
Läsbart namn för distributionen.
dependsOn
sträng | stränglista.
Alla jobb som måste slutföras före den här.
condition
Sträng.
Utvärdera det här villkorsuttrycket för att avgöra om distributionen ska köras.
continueOnError
Sträng.
Vill du fortsätta köra även vid fel?
timeoutInMinutes
Sträng.
Det är dags att vänta tills det här jobbet har slutförts innan servern avlöser det.
cancelTimeoutInMinutes
Sträng.
Det är dags att vänta tills jobbet avbryts innan det avslutas med två skäl.
variables
variabler.
Distributionsspecifika variabler.
pool
pool.
Pool där det här jobbet ska köras.
environment
jobs.deployment.environment.
Målmiljönamn och eventuellt ett resursnamn för att registrera distributionshistoriken. format: environment-name.resource-name.
strategy
jobs.deployment.strategy.
Körningsstrategi för den här distributionen.
workspace
arbetsyta.
Arbetsytealternativ för agenten.
uses
jobs.job.uses.
Alla resurser som krävs av det här jobbet som inte redan refereras.
container
jobs.job.container.
Namnet på containerresursen.
services
strängordlista.
Containerresurser som ska köras som en tjänstcontainer.
templateContext
templateContext.
Distributionsrelaterad information som skickas från en pipeline när en mall utökas. Mer information finns i kommentarer. Mer information om templateContext
finns i Extended YAML Pipelines templates can now be passed context information for stages, jobs, and deployments and Templates – Use templateContext to pass properties to templates .
Kommentarer
I YAML-pipelines rekommenderar pipelineteamet att du lägger dina distributionssteg i ett distributionsjobb.
Mer information om templateContext
finns i Extended YAML Pipelines templates can now be passed context information for stages, jobs, and deployments and Templates – Use templateContext to pass properties to templates .
Exempel
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