jobs.job.strategy definition

The matrix and parallel keywords specify mutually exclusive strategies for duplicating a job.

Properties that use this definition: pipeline.strategy, jobs.job.strategy

Properties that use this definition: pipeline.strategy, jobs.job.strategy

Properties that use this definition: pipeline.strategy, jobs.job.strategy

Properties that use this definition: pipeline.strategy, jobs.job.strategy

Properties that use this definition: pipeline.strategy, jobs.job.strategy

Properties that use this definition: pipeline.strategy, jobs.job.strategy

Overloads

Overload Description
strategy: matrix, maxParallel Matrix job strategy.
strategy: parallel Parallel job strategy.
Overload Description
strategy: matrix, maxParallel Matrix job strategy.
strategy: parallel Parallel job strategy.
Overload Description
strategy: matrix, maxParallel Matrix job strategy.
strategy: parallel Parallel job strategy.
Overload Description
strategy: matrix, maxParallel Matrix job strategy.
strategy: parallel Parallel job strategy.
Overload Description
strategy: matrix, maxParallel Matrix job strategy.
strategy: parallel Parallel job strategy.
Overload Description
strategy: matrix, maxParallel Matrix job strategy.
strategy: parallel Parallel job strategy.

strategy: matrix, maxParallel

Use of a matrix generates copies of a job, each with different input. These copies are useful for testing against different configurations or platform versions.

strategy:
  matrix: { string1: { string2: string3 } } # Matrix defining the job strategy; see the following examples.
  maxParallel: string # Maximum number of jobs running in parallel. 

Properties

matrix

jobMatrix

Matrix defining the job strategy; see the following examples.

maxParallel

string

Maximum number of jobs running in parallel.

strategy:
  matrix: { string1: { string2: string3 } } # Matrix defining the job strategy; see the following examples.
  maxParallel: string # Maximum number of jobs running in parallel. 

Properties

matrix

jobMatrix

Matrix defining the job strategy; see the following examples.

maxParallel

string

Maximum number of jobs running in parallel.

strategy:
  matrix: { string1: { string2: string3 } } # Matrix defining the job strategy; see the following examples.
  maxParallel: string # Maximum number of jobs running in parallel. 

Properties

matrix

jobMatrix

Matrix defining the job strategy; see the following examples.

maxParallel

string

Maximum number of jobs running in parallel.

strategy:
  matrix: { string1: { string2: string3 } } # Matrix defining the job strategy; see the following examples.
  maxParallel: string # Maximum number of jobs running in parallel. 

Properties

matrix

jobMatrix

Matrix defining the job strategy; see the following examples.

maxParallel

string

Maximum number of jobs running in parallel.

strategy:
  matrix: { string1: { string2: string3 } } # Matrix defining the job strategy; see the following examples.
  maxParallel: string # Maximum number of jobs running in parallel. 

Properties

matrix

jobMatrix

Matrix defining the job strategy; see the following examples.

maxParallel

string

Maximum number of jobs running in parallel.

strategy:
  matrix: { string1: { string2: string3 } } # Matrix defining the job strategy; see the following examples.
  maxParallel: string # Maximum number of jobs running in parallel. 

Properties

matrix

jobMatrix

Matrix defining the job strategy; see the following examples.

maxParallel

string

Maximum number of jobs running in parallel.

Remarks

strategy:
  matrix: { string1: { string2: string3 } }
  maxParallel: number

For each occurrence of string1 in the matrix, a copy of the job is generated. The name string1 is the copy's name and is appended to the name of the job. For each occurrence of string2, a variable called string2 with the value string3 is available to the job.

Note

Matrix configuration names must contain only basic Latin alphabet letters (A-Z and a-z), digits (0-9), and underscores (_). They must start with a letter. Also, their length must be 100 characters or fewer.

The optional maxParallel keyword specifies the maximum number of simultaneous matrix legs to run at once.

If maxParallel is unspecified or set to 0, no limit is applied.

If maxParallel is unspecified, no limit is applied.

Note

The matrix syntax doesn't support automatic job scaling but you can implement similar functionality using the each keyword. For an example, see expressions.

Examples

jobs:
- job: Build
  strategy:
    matrix:
      Python35:
        PYTHON_VERSION: '3.5'
      Python36:
        PYTHON_VERSION: '3.6'
      Python37:
        PYTHON_VERSION: '3.7'
    maxParallel: 2

This matrix creates three jobs: "Build Python35," "Build Python36," and "Build Python37." Within each job, a variable named PYTHON_VERSION is available. In "Build Python35," the variable is set to "3.5". It's likewise set to "3.6" in "Build Python36." Only two jobs run simultaneously.

strategy: parallel

This strategy specifies how many duplicates of a job should run. It's useful for slicing up a large test matrix. The Visual Studio Test task understands how to divide the test load across the number of scheduled jobs.

strategy:
  parallel: string # Run the job this many times. 

Properties

parallel

string

Run the job this many times.

strategy:
  parallel: string # Run the job this many times. 

Properties

parallel

string

Run the job this many times.

strategy:
  parallel: string # Run the job this many times. 

Properties

parallel

string

Run the job this many times.

strategy:
  parallel: string # Run the job this many times. 

Properties

parallel

string

Run the job this many times.

strategy:
  parallel: string # Run the job this many times. 

Properties

parallel

string

Run the job this many times.

strategy:
  parallel: string # Run the job this many times. 

Properties

parallel

string

Run the job this many times.

Examples

jobs:
- job: SliceItFourWays
  strategy:
    parallel: 4