Create composition

1. Add a composition

Click the Composition view icon in the left pane, and click the ADD COMPOSITION button.

codefresh_add_composition_first.png

2. Enter the name of composition

In the Composition Name text box, type a name for your composition and click NEXT

codefresh_name_composition.png

3. Select Composition Starting Point

On this screen you can choose: What type of composition would you like to create?

Click NEXT for chosen way.

codefresh_method_compose.png

3.1 From file in repo

Start a new composition from a docker compose file in your repository.

  1. In the search box, type the name of the repository.

codefresh_compose_add.png

Don’t see your private repositories?

Try the following:

  • Started your free trial, so you can add private repositories.
  • If the free trial finished you can upgrade your account or contact us to extend the free trial.
  • Visit our Troubleshooting Center
Can’t find your repository?

Try the ADD BY URL option.

codefresh_compose_by_url.png

  1. From the drop-down menu, select a branch for the first build.
  1. Click NEXT.
  1. Enter the path to docker-compose.yml By default, Codefresh searches for your docker-compose.yml at the root level of your repository, by the name docker-compose.yml. In case that your docker-compose.yml is in sub-directory, provide the path as well (./foo/bar/docker-compose.yml).

codefresh_path_docker_compose.png

  1. Click NEXT

We don’t support build property of compose. We will replace it with images built by pipeline that automatically created.
Also in case if you have build property in your docker-compose.yml will be created a repository with pipeline for step that contains build property.

codefresh_replace_build.png

  1. Click CREATE

codefresh_compose_repo_created.png

Now you can choose what to do next: BUILD IMAGES or CONFIGURE COMPOSITION In case if you chose CONFIGURE COMPOSITION you will see the following screen where you will be able to edit your composition and then launch if all necessary images was created.

codefresh_first_composition.png

In case if you chose BUILD IMAGES all pipelines from added repository will be triggered to create a necessary images.

3.2 From template

If your repository doesn’t include docker-compose.yml, you can use one of our templates to see how it works!

  1. Choose the template
  1. Click CREATE

codefresh_template_composition.png

You will see the editor of composition where you can change something and then launch this composition to see results.

codefresh_template_compose_edit.png

Click on the rocket icon to launch this composition.

3.3 Empty composition

If you chose the Empty composition you want to create a composition from scratch. You will see the following screen with empty composition.

  1. To add a service, click the Add Service button. You can add existing built services, or provide the name for Docker image that will be pulled from Docker registry.
  1. (Optional) Click the Edit button to edit the content based on Docker Compose YAML .

codefresh_empty_compose.png

  1. Click the Save icon on the upper right corner

Click on the rocket icon to launch this composition.