Skip to content

job_matrix reference

MrBr-github edited this page Jul 27, 2022 · 7 revisions

steps

list of steps to be executed

Steps can contain any number of name/run sections and all will be executed
every matrix dimension will run in parallel with all other dimensions
steps itself has sequential execution
NOTE:
shell environment variable representing dimension values will be inserted automatically and can be used run section
$name represents current value for docker name
Also $driver $cuda,$arch env vars are available and can be used from shell
$variant represents current axis serial number (relative to docker loop)

steps:
  # required fields
  - name: step 1 
    run: echo 123
  # optional fields
    archiveArtifacts: 'cov.log'
    shell: <shebang>|action
    module: groovy

name

Name of the step

run

contains shell script for execution.
Note: multiple steps on same executor share same file system, but executed in different shells (i.e. no variables propagation nor inheritance)

archiveArtifacts

Saves listed file as a job artifact, can be a standard filesystem regex var/*.log
File location is relative to $WORKSPACE

shell

Possible values:

  • <shebang> - any valid shell shebang. Whit or without preceding #
    example: #/bin/bash might be used on ubuntu containers to run step in bash instead of default dash
  • action - predefined value. Enables module usage. Requires module parameter if used

module

pre-defined action defined at https://github.com/Mellanox/ci-demo/tree/master/vars
Requires shell parameter to be set as action

Possible values:

  • dynamicAction - --TBD--

  • groovy - allows jenkins pipeline groovy script in run section instead of shell

    Example
    - name: Trigger external job
      containerSelector: "{name: 'blackduck'}"
      shell: action
      module: groovy
      run: |
        build job: 'cidemo-trigger-test', wait: true
    
  • ngci.groovy - --TBD--

pipeline_start

Always runs at the beginning of the job before all other steps

pipeline_start
  # required fields
  run: echo Starting new job
  # optional fields
  image: ubuntu:20.04
  containerSelector: "{name: 'scheduler'}"

run

contains shell script for execution

image

Docker image url/name to execute this step in. Will run in new container

containerSelector

Filter that will use container defined in runs_on_dockers
Overrides (image)[#image] parameter
Will run in new container sourced from the same image

pipeline_stop

Always runs at the end of the job after all other steps

See pipeline_start for available parameters