jobs.<job_id>.services is a Preview feature.
|
|
A Preview feature:
Product features and documentation are frequently updated. If you find an issue or have a suggestion, please contact CloudBees Support. |
Use jobs.<job_id>.services to run a service in a separate container alongside the job for the duration of the run, providing functionality such as a database or application server.
Example usage
This example starts a PostgreSQL service, sets credentials with environment variables, and verifies connectivity with a simple SQL query.
| 1 | Declares service containers that run alongside the job. |
| 2 | Names the PostgreSQL service. |
| 3 | Pins the service image version. |
| 4 | Provides environment variables consumed by the postgres image at startup. |
| 5 | Sets default user, password, and database created by the service. |
| 6 | Connects to the service on localhost:5432 using the configured credentials. |