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

Run a Docker Compose file composition

Run a docker-compose.yml composition as a pipeline step.

arguments

  • 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. We support most features of Docker compose version 2.0 and 3.0
  • composition_candidates - The definition of the service to monitor. Each candidate has a single command parameter that decides what will be tested.
  • composition_variables - A set of environment variables to substitute in the composition. Notice that these variables are docker-compose variables and NOT environment variables
  • 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}}. Note that this is completely different from working_dir which is on the service level.
    Composition:
  title: Running Composition
  type: composition
  arguments:
    composition:
      version: '2'
      services:
        db:
          image: postgres
    composition_candidates:
      test_service:
        image: '${{build_step}}'
        command: gulp integration_test
        working_dir: /app
        environment:
          - key=value

  
github.com
Codefresh INC
Jun 10, 2020