Codefresh Steps: Reusable Code for Common Operations
This page provides code you can use to perform common operations in the Codefresh CI/CD platform.
18.7M

Run a Codefresh pipeline codefresh-run

Run a Codefresh pipeline by ID or name and attach the created build logs.

arguments

  • BRANCH - Branch for which to run the pipeline. When defined, TRIGGER_ID must also be defined.
  • CONTEXT - Run pipeline with execution contexts.
  • DETACH - Run child pipeline and export the child pipeline's build ID to the $BUILD_ID variable without waiting for the pipeline to complete.
  • ENABLE_NOTIFICATIONS - Send email notifications on pipeline build status.
  • FOLLOW_LOGS - Run pipeline and follow its logs.
  • IMAGE_TAG - Custom image of codefresh-run step
  • NO_CACHE - Ignore cached images.
  • NO_CF_CACHE - Ignore Codefresh cache optimizations.
  • ONLY - Run only specifc steps defined.
  • PACK_NAME - Resources size (small, medium or large).
  • PIPELINE_ID - Name or ID of pipeline to run. In the UI, select Pipelines. Click pipeline name, then select Settings, and get the Name and ID.
  • RESET_VOLUME - Reset pipeline cached volume.
  • RUNTIME_NAME - Runtime environment to run the pipeline.
  • SHA - Git commit hash. When defined, TRIGGER_ID must also be defined.
  • SKIP - Skip the specifc steps defined.
  • TERMINATE_ON_TIMEOUT - Terminate build if timeout reached
  • TIMEOUT_MINS - Timeout in minutes after which to consider pipeline build as failed.
  • TRIGGER_ID - Name or ID of trigger for specified pipeline. Mandatory when BRANCH or SHA are defined. In the UI, select Pipelines. Click pipeline name, then select Workflows > Triggers. Click Edit and get the Name.
  • VARIABLE - Set build variables.
  • VARIABLE_FILE - Import build variables from a file.
  • YAML - Path to pipeline's yaml to be used as override for this execution.
    codefresh-run:
  title: Run a codefresh pipeline
  type: codefresh-run
  arguments:
    PIPELINE_ID: project-name/pip_name
    TRIGGER_ID: trigger_id
    BRANCH: '${{CF_BRANCH}}'
    SHA: '${{CF_REVISION}}'
    VARIABLE:
      - key1=val1
      - key2=val2

  
github.com
Itai Gendler
Jul 24, 2023