Services


Services

Services run side-by-side with CI jobs

Services can be declared using the services keyword

Services are accessed using the image name (or an alias)

Services are available for runners with Docker/Kubernetes executor

GitLab only starts the service

No guarantee of availability


Hands-On

Recommendation: Implement in dedicated project

  1. Add top-level service based on nginx

     services:
     - nginx:1.20.2
    
  2. Access service from job

     test:
       script:
       - curl -s http://nginx
    
  3. Check pipeline

See new .gitlab-ci.yml:

git checkout origin/160_gitlab_ci/220_services -- '*'