Anteckning
Åtkomst till den här sidan kräver auktorisering. Du kan prova att logga in eller ändra kataloger.
Åtkomst till den här sidan kräver auktorisering. Du kan prova att ändra kataloger.
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: 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
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 jobbet har slutförts innan servern avslutar det.
cancelTimeoutInMinutes sträng.
Tid att vänta tills jobbet avbryts innan det avslutas med två skäl.
variables
variabler.
Distributionsspecifika variabler.
pool
slå samman.
pool dä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 på agenten.
Mer information om arbetsytor, inklusive alternativ för rensning, finns i avsnittet arbetsyta i Jobb.
uses
jobs.job.uses.
Anger resurser som krävs av det här jobbet som inte redan refereras någon annanstans i pipelinen, till exempel genom ett utcheckningssteg eller en lagringsplatsresurs. Mer information om usesfinns i Begränsa omfånget för jobbauktorisering och "använder"-instruktionen för fördeklarering av resurser.
container
jobs.job.container.
containerresursnamn.
services strängordlista.
containerresurser som ska köras som en tjänstcontainer.
templateContext templateContext.
Distributionsrelaterad information som skickas från en pipeline när du utökar en mall. Mer information finns i kommentarer. Mer information om templateContextfinns i utökade YAML Pipelines-mallar kan nu skickas kontextinformation för steg, jobb och distributioner och mallar – Använd templateContext för att skicka egenskaper till mallar.
Anmärkningar
I YAML-pipelines rekommenderar pipelineteamet att du lägger dina distributionssteg i ett distributionsjobb.
Mer information om templateContextfinns i utökade YAML Pipelines-mallar kan nu skickas kontextinformation för steg, jobb och distributioner och mallar – Använd templateContext för att skicka egenskaper till mallar.
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