jobs.<job_id>.services.<service_id>.image

1 minute read
On this page
jobs.<job_id>.services.<service_id>.image is a Preview feature.
A Preview feature:
  • Has not undergone end-to-end testing with CloudBees products.

  • Is provided without service-level agreements (SLA), and therefore does not include CloudBees' commitment to functionality or performance.

  • May impact other stable areas of the product when used.

  • May have limited documentation.

  • May not be feature-complete during the Preview period.

  • May graduate from Preview to a supported feature or be removed from the product.

  • May introduce breaking changes that prevent upgrades due to incompatibility with future development.

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.<service_id>.image to specify the service Docker image.

Example usage

To allow the steps within a job to access the service instances, use localhost or 127.0.0.1 as the host and the corresponding port for the service.
apiVersion: automation.cloudbees.io/v1alpha1 kind: workflow name: MySQL service example on: push jobs: test: services: my-service: image: mysql:8.0 env: MYSQL_ROOT_PASSWORD: examplepassword MYSQL_DATABASE: exampledb args: "--default-authentication-plugin=mysql_native_password" steps: - name: Wait for MySQL service to be ready uses: docker://mysql:8.0 run: | until mysqladmin ping -h 127.0.0.1 --silent; do echo "Waiting for database connection..." sleep 2 done env: MYSQL_PWD: examplepassword - name: Run a query uses: docker://mysql:8.0 run: | echo "SHOW DATABASES;" | mysql -u root -h 127.0.0.1 env: MYSQL_PWD: examplepassword