Custom services

On top of predefined services, you can create your own service from scratch.

This feature allows you, for example, to run tests for both frontend and backend of your application, or to create a database service with custom configuration and use it in your builds.

Configuration

Custom services are available in the Services tab of build actions:

Service list in BuddyService list in Buddy

Upon adding the custom service, the following needs to be defined:

  1. Options – here you define how the service communicates with other containers:
    • Hostname – the ID that other services use to connect to the service.
    • Wait for port – if specified, the action will wait until the service is available at the provided port.
    • Pass variables to this service – allows passing user-defined variables to the service. This option is always on as custom services have no default variables that could overwrite them.

Options tab in custom service configurationOptions tab in custom service configuration

  1. Image – the Docker image from the service is launched from. You can use images hosted on Docker registries, or created by pipeline actions.
  2. Caching – use this option to attach the pipeline filesystem to the service if it requires access to files from version control (e.g. config files). You can also cache data in the service to speed up your builds. The mounted volumes will remain persistent between pipeline runs until the cache is cleared by the user.

Caching tab in custom service configurationCaching tab in custom service configuration

Using custom images as service

Containers are launched from Docker images. By default, Buddy pulls the image from the selected Docker registry. You can also use an image built by a preceding action in the pipeline.

For instance, you can build separate images for backend and frontend of your application, and then use the Custom container action to run the tests with both images attached as services:

Example pipeline with Docker build actionsExample pipeline with Docker build actions

To do that, set the image location tab to From action, and select the action that builds the image:

Selecting service imageSelecting service image

Last update:
Sep 17, 2024