Run Pipeline

Description

Run a pipeline by id or name and attach the created workflow logs.

Returns an exit code according to the workflow finish status (Success: 0, Error: 1, Terminated: 2).

Command

codefresh run <name>

Arguments

Option Alias Default Description
name Pipeline name

Options

Option Alias Default Description
–help Print help information
–branch - b Branch
–sha - s Set commit sha
–no-cache - nc Ignore cached images
–enable-notifications - en Report notifications about pipeline execution
–reset-volume - rv Reset pipeline cached volume
–variable - v Set build variables
–detach - d Run pipeline and print build ID
–context - c Run pipeline with contexts
–variable-file - var-file Set build variables from a file

variable-file (var-file)

It is possible to pass build variables using a file. (supported format: json and yaml)
The variables file structure should be an array.
The pipeline will be triggered multiple times according to the array length.

Variable yaml file with 2 sets of variables

- key: value
  key2: key1
- key: value
  key2: key2

Variable json file with 2 sets of variables

[
  {
    "key": "value",
    "key2": "key1"
  },
  {
    "key": "value",
    "key2": "key2"
  }
]

Examples

Defining the source control context using a branch

codefresh run PIPELINE_ID | PIPELINE_NAME -b=master

Defining the source control context using a commit

codefresh run PIPELINE_ID | PIPELINE_NAME -s=52b992e783d2f84dd0123c70ac8623b4f0f938d1

Setting variables through the command

codefresh run PIPELINE_ID | PIPELINE_NAME -b=master -v key1=value1 -v key2=value2

Settings variables through a yml file

codefresh run PIPELINE_ID | PIPELINE_NAME -b=master --var-file ./var_file.yml

Inject contexts to the pipeline execution

codefresh run PIPELINE_ID | PIPELINE_NAME -b=master --context context