Quick example:


version: '1.0'
    type: build
    description: Building the image...
    image-name: myuser/myservice
    tag: develop # ${{CF_BRANCH}}

    image: node:5
    working_directory: ${{main_clone}}
    description: Performing unit tests...
      - npm install gulp -g 
      - npm install
      - gulp unit_test

You can customize your build environment (pipeline) by using the Codefresh YAML file, codefresh.yml. Codefresh uses the build specifications in the codefresh.yml file to execute your build. The codefresh.yml can be basic, or include intricate build specifications.

A YAML file is comprised of a series of steps that are executed in the order in which they are specified.


version: '1.0'


You must define a step type for each step. Each step uses Docker images and containers as facilitators for execution. For example, the Freestyle step spins up a container and executes the specified shell commands from the YAML file.

Each step produces a resource, which you can reference in other steps, and are executed in real-time. For example, a Freestyle step can reference an image that was produced by a Build step. This allows you to chain steps together, and create highly-customized builds.


Steps chaining and referencing is possible due to implementation of variables in yml file - read more on relevant section

Step Type Description
Build Builds a Docker image.
Push Pushes a Docker image to a Docker registry.
Git Clone That step not required and added automatically
Composition Start a finite Docker Composition.
Launch Composition Start a long term Docker composition
Freestyle Execute one or more shell commands.

To build your pipeline using a codefresh.yml file, in the General Settings section, toggle the Use YML build option to the ON position.

pipeline definition options

Switching between the legacy build engine and the YAML build engine