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:
Image loading...
Upon adding the custom service, the following needs to be defined:
- 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.
Image loading...
- Image – the Docker image from the service is launched from. You can use images hosted on Docker registries, or created by pipeline actions.
- 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.
Image loading...
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:
Image loading...
To do that, set the image location tab to From action, and select the action that builds the image:
Image loading...
Last modified on Sep 23, 2024