Launch-Composition step

Create a test environment with its dependencies in Codefresh infrastructure

The Launch Composition step provides the ability to launch long term running environments that can live outside the context of a running pipeline. You can use this step to automate your test environment creation through a codefresh.yml file instead of manually launching an environment from the UI.

Note that “launch-composition” creates a permanent test environment that keeps running even after a pipeline has finished. If you just want temporary test environments that run only while a pipeline is running, see service containers and the documentation page for integration tests.

Usage

ui defined composition

step_name:
  title: Step Title
  type: launch-composition
  composition: 'ui_defined_composition_name'
  environment_name: 'environment name'
  on_success:
    ...
  on_fail:
    ...
  on_finish:
    ...

inline composition

step_name:
  type: launch-composition
  composition:
    version: '2'
    services:
      app:
        image: owner/app:latest
      db:
        image: mongo
  environment_name: 'environment name'
  on_success:
    ...
  on_fail:
    ...
  on_finish:
    ...
  retry:
    ...  

from file composition

step_name:
  type: launch-composition
  working_directory: $
  composition: './path/to/docker-compose.yaml'
  environment_name: 'environment name'
  on_success:
    ...
  on_fail:
    ...
  on_finish:
    ...

Fields

Field Description Required/Optional/Default
title The free-text display name of the step. Optional
description A basic, free-text description of the step. Optional
stage Parent group of this step. See using stages for more information. Optional
working_directory The directory in which to search for the composition file. It can be an explicit path in the container’s file system, or a variable that references another step.
The default is ${{main_clone}}.
Default
composition The composition you want to run. It can be an inline YAML definition, a path to a composition file on the file system, or the logical name of a composition stored in the Codefresh system. Required
environment_name The environment name that will be given. In case a previous environment exists with the same name, it will first be terminated. The default value will the be the name/path provided in the ‘composition’ field. Default
composition_variables A set of environment variables to substitute in the composition. Optional
fail_fast If a step fails, and the process is halted. The default value is true. Default
when Define a set of conditions which need to be satisfied in order to execute this step.
You can find more information in the conditional execution of steps article.
Optional
on_success, on_fail and on_finish Define operations to perform upon step completion using a set of predefined post-step operations. Optional
entry_point The name of main service Optional
retry Define retry behavior as described in retrying a step. Optional

On-demand environment quick start
Launch Composition example
Integration testing
Service containers in pipelines