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 Type Default Description
–help Print help information
–trigger -t Trigger id or name
–branch -b Branch
–memory Mention machine memory sizes during pipeline run
–cpu Mention machine cpu sizes during pipeline run
–disk Mention machine disk space sizes during pipeline run
–pack-name Resources size (small, medium or large)

Possible values:
- small
- medium
- large
–runtime-name Runtime environment for run pipeline
–sha -s Set commit sha
–no-cache –nc boolean false Ignore cached images
–annotation -a array Add annotations to created build
–enable-notifications –en boolean false Report notifications about pipeline execution
–reset-volume –rv boolean false Reset pipeline cached volume
–variable -v array Set build variables
–secret -S array Set build secrets
–detach -d Run pipeline and print build ID
–context -c array Run pipeline with contexts
–local boolean false Run pipeline on your local docker machine
–local-volume –lv Use your file system as volume in local run
–no-cf-cache –ncfc boolean false Ignore Codefresh cache optimizations
–only run only specific steps
–skip skip specific steps
–debug debug mode
–variable-file –var-file Set build variables from a file
–yaml -y Override codefresh.yaml for this execution

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

Choosing a specific trigger

codefresh run PIPELINE_ID | PIPELINE_NAME --trigger TRIGGER_ID | TRIGGER_NAME -b=master

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

Skip specific steps

codefresh run PIPELINE_ID | PIPELINE_NAME --skip step1 step2 step3