jobs.<job_id>.services.<service_id>.args

2 minute read
On this page
jobs.<job_id>.services.<service_id>.args 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>.args to set the arguments passed to the ENTRYPOINT of the service container. Follow these args specification guidelines:

  • Enter the args parameter as Unicode string.

  • Arguments containing spaces must be surrounded by double quotes ("").

  • An escape character \ is supported. Use \ for arguments that contain spaces. For example, surround an argument using \" or "\"".

When using CMD in the Dockerfile, use one of the following workflow guidelines:

  • (Recommended) delete any required arguments from CMD.

  • Define appropriate defaults so service runs without specifying arguments.

  • If a --help flag, or something similar is available, use that as the default for documentation.

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