The script parameter

The most common parameter to a job, script is used to define any commands that should be run in the job. In our preceding example, we have the following:

phpunit:  script:    - vendor/bin/phpunit tests/ROT13FormatterTest

In the phpunit job, we have the scripts parameter, which tells GitLab to execute vendor/bin/phpunit tests/ROT13FormatterTest. It's worth noting that commands with special characters (such as a colon, brackets, ampersand, greater/less than, and so on) could be interpreted as part of the YAML, so it's prudent to wrap any such commands in single or double quotes to ensure that they are run as a command.

Get GitLab Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.