définition jobs.deployment
Un travail de déploiement est un type spécial de travail. Il s’agit d’une collection d’étapes à exécuter séquentiellement sur l’environnement.
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
Définitions qui font référence à cette définition : travaux
Propriétés
deployment
String. Obligatoire comme première propriété.
Nom du travail de déploiement, A-Z, a-z, 0-9 et trait de soulignement. Le mot déployer est un mot clé et n’est pas pris en charge comme nom de déploiement.
displayName
String.
Nom lisible par l’homme pour le déploiement.
dependsOn
string | string list.
Tous les travaux qui doivent se terminer avant celui-ci.
condition
String.
Évaluez cette expression de condition pour déterminer s’il faut exécuter ce déploiement.
continueOnError
String.
Continuez à exécuter même en cas d’échec ?
timeoutInMinutes
String.
Le temps d’attendre la fin de ce travail avant que le serveur ne le tue.
cancelTimeoutInMinutes
String.
Délai d’attente pour que le travail s’annule avant de l’arrêter de force.
variables
variables.
Variables spécifiques au déploiement.
pool
pool.
Pool dans lequel ce travail s’exécutera.
environment
jobs.deployment.environment.
Nom de l’environnement cible et éventuellement nom de ressource pour enregistrer l’historique du déploiement ; format : nom-environnement.resource-name.
strategy
jobs.deployment.strategy.
Stratégie d’exécution pour ce déploiement.
workspace
espace de travail.
Options de l’espace de travail sur l’agent.
uses
jobs.job.uses.
Toutes les ressources requises par ce travail qui ne sont pas déjà référencées.
container
jobs.job.container.
Nom de la ressource de conteneur.
services
dictionnaire de chaînes.
Ressources de conteneur à exécuter en tant que conteneur de service.
templateContext
templateContext.
Informations relatives au déploiement transmises à partir d’un pipeline lors de l’extension d’un modèle. Pour plus d’informations, consultez les remarques. Pour plus d’informations sur templateContext
, consultez Modèles de pipelines YAML étendus peuvent désormais être transmis des informations de contexte pour les étapes, les travaux et les déploiements et modèles - Utiliser templateContext pour passer des propriétés aux modèles.
Notes
Dans les pipelines YAML, l’équipe de pipelines vous recommande de placer vos étapes de déploiement dans un travail de déploiement.
Pour plus d’informations sur templateContext
, consultez Modèles de pipelines YAML étendus peuvent désormais être transmis des informations de contexte pour les étapes, les travaux et les déploiements et modèles - Utiliser templateContext pour passer des propriétés aux modèles.
Exemples
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