Difference between revisions of "Azure pipelines: Jobs:"

From wikieduonline
Jump to navigation Jump to search
Line 10: Line 10:
  
 
== Job full syntax ==
 
== Job full syntax ==
<pre>
+
 
- job: string          # name of the job, A-Z, a-z, 0-9, and underscore
+
- job: string          # name of the job, A-Z, a-z, 0-9, and underscore
  displayName: string  # friendly name to display in the UI
+
  displayName: string  # friendly name to display in the UI
  dependsOn: string | [ string ]
+
  dependsOn: string | [ string ]
  condition: [ always() | failed () | .../... ]    # Ref https://docs.microsoft.com/en-us/azure/devops/pipelines/process/conditions
+
  condition: [ always() | failed () | .../... ]    # Ref https://docs.microsoft.com/en-us/azure/devops/pipelines/process/conditions
  strategy:
+
  strategy:
    parallel:          # parallel strategy
+
    parallel:          # parallel strategy
    matrix:            # matrix strategy
+
    matrix:            # matrix strategy
    maxParallel: number # maximum number simultaneous matrix legs to run
+
    maxParallel: number # maximum number simultaneous matrix legs to run
    # note: `parallel` and `matrix` are mutually exclusive
+
    # note: `parallel` and `matrix` are mutually exclusive
    # you may specify one or the other; including both is an error
+
    # you may specify one or the other; including both is an error
    # `maxParallel` is only valid with `matrix`
+
    # `maxParallel` is only valid with `matrix`
  continueOnError: boolean  # 'true' if future jobs should run even if this job fails; defaults to 'false'
+
  continueOnError: boolean  # 'true' if future jobs should run even if this job fails; defaults to 'false'
  pool: pool                # agent pool
+
  pool: pool                # agent pool
  workspace:
+
  workspace:
    clean: outputs | resources | all # what to clean up before the job runs
+
    clean: outputs | resources | all # what to clean up before the job runs
  container: containerReference      # container to run this job inside
+
  container: containerReference      # container to run this job inside
  timeoutInMinutes: number          # how long to run the job before automatically cancelling
+
  timeoutInMinutes: number          # how long to run the job before automatically cancelling
  cancelTimeoutInMinutes: number      # how much time to give 'run always even if cancelled tasks' before killing them
+
  cancelTimeoutInMinutes: number      # how much time to give 'run always even if cancelled tasks' before killing them
  variables: { string: string } | [ variable | variableReference ]  
+
  variables: { string: string } | [ variable | variableReference ]  
  steps: [ script | bash | pwsh | powershell | checkout | task | templateReference ]
+
  steps: [ script | bash | pwsh | powershell | checkout | task | templateReference ]
  services: { string: string | container } # container resources to run as a service container
+
  services: { string: string | container } # container resources to run as a service container
  uses:                              # Any resources (repos or pools) required by this job that are not already referenced
+
  uses:                              # Any resources (repos or pools) required by this job that are not already referenced
    repositories: [ string ]          # Repository references to Azure Git repositories
+
    repositories: [ string ]          # Repository references to Azure Git repositories
    pools: [ string ]                # Pool names, typically when using a matrix strategy for the job
+
    pools: [ string ]                # Pool names, typically when using a matrix strategy for the job
</pre>
 
  
 
== Related ==
 
== Related ==

Revision as of 11:33, 13 March 2022


Job full syntax

- job: string           # name of the job, A-Z, a-z, 0-9, and underscore
  displayName: string   # friendly name to display in the UI
  dependsOn: string | [ string ]
  condition: [ always() | failed () | .../... ]    # Ref https://docs.microsoft.com/en-us/azure/devops/pipelines/process/conditions
  strategy:
    parallel:           # parallel strategy
    matrix:             # matrix strategy
    maxParallel: number # maximum number simultaneous matrix legs to run
    # note: `parallel` and `matrix` are mutually exclusive
    # you may specify one or the other; including both is an error
    # `maxParallel` is only valid with `matrix`
  continueOnError: boolean  # 'true' if future jobs should run even if this job fails; defaults to 'false'
  pool: pool                # agent pool
  workspace:
    clean: outputs | resources | all # what to clean up before the job runs
  container: containerReference      # container to run this job inside
  timeoutInMinutes: number           # how long to run the job before automatically cancelling
  cancelTimeoutInMinutes: number      # how much time to give 'run always even if cancelled tasks' before killing them
  variables: { string: string } | [ variable | variableReference ] 
  steps: [ script | bash | pwsh | powershell | checkout | task | templateReference ]
  services: { string: string | container } # container resources to run as a service container
  uses:                               # Any resources (repos or pools) required by this job that are not already referenced
    repositories: [ string ]          # Repository references to Azure Git repositories
    pools: [ string ]                 # Pool names, typically when using a matrix strategy for the job

Related

See also

Advertising: