Services¶
Overview¶
A service in IceCI is a container that is running during the whole pipeline execution. Services let you run backing containers for your pipeline - for example a PostgreSQL database for your integration tests.
Every service has a name - in the pipeline it can be resolved using this name. If you create a website service, running curl http://website
command in your pipeline step
will hit the website service assuming that it’s a container listening on port 80 (like nginx, for example).
Note
The pipeline will stop all services after finishing - regardless of the pipeline result.
Warning
If a service stops during the pipeline execution, the pipeline will fail no matter what was the exit code of the service main process.
Examples¶
Hitting an nginx service¶
Below is an example of a working pipeline running a website service
and a step1 step
that will curl the nginx container running as the website service
.
services:
- name: website
image: nginx
steps:
- name: step1
containerRun:
image: iceci/utils
script: "curl http://website/"