| `SPECTRAL_IMAGE` | The Docker image used to run `spectral` | `registry.hub.docker.com/spectral:latest` |
| `SPECTRAL_IMAGE` | The Docker image used to run `spectral` | `registry.hub.docker.com/stoplight/spectral:latest` |
## Jobs
### `spectral-build` job
### `spectral` job
This job performs **build and tests** at once.
This job performs a [lint analysis](https://meta.stoplight.io/docs/spectral/docs/guides/2-cli.md) of your API document(s) (OpenAPI, AsyncAPI...), mapped to the `build` stage.
| `SPECTRAL_BUILD_ARGS` | Arguments used by the build job | `build --with-default-args` |
| `SPECTRAL_DOCUMENTS` | Location of JSON/YAML documents to be linted. Can be either a file, a glob or fetchable resource(s) on the web | `{,api/,src/main/resources/}*{openapi,oas,swagger,asyncapi}*.{json,yml,yaml}`<br><br>see [glob syntax](https://github.com/mrmlnc/fast-glob#basic-syntax) for more details |
| `SPECTRAL_EXTRA_ARGS` | Extra arguments for the [Spectral CLI](https://meta.stoplight.io/docs/spectral/docs/guides/2-cli.md) | _none_ |
| `SPECTRAL_DISABLED` | Set to `true` to disable this job | _none_ |
### SonarQube analysis
If you're using the SonarQube template to analyse your SPECTRAL code, here are 2 sample `sonar-project.properties` files.
If you don't specify an explicit ruleset file with the `--ruleset` option, the Spectral CLI looks for a ruleset file called `.spectral.yml`, `.spectral.yaml`, `.spectral.json` or `.spectral.js` in the current working directory.
This job performs a [lint](link-to-the-tool) analysis of your code, mapped to the `build` stage.
If none is present in your project, the template creates a default `.spectral.yaml` file with below content:
"description":"[Spectral](https://docs.stoplight.io/docs/spectral) is a JSON/YAML Linter with custom rulesets",
"description":"[Spectral](https://docs.stoplight.io/docs/spectral) is a JSON/YAML Linter with custom rulesets, out of the box support for OpenAPI and AsyncAPI",
# (example) publish job activated on env ($SPECTRAL_PUBLISH_ENABLED), with required $SPECTRAL_PUBLISH_LOGIN and $SPECTRAL_PUBLISH_PASSWORD env verification
spectral-publish:
extends:.spectral-base
stage:publish
before_script:
-*spectral-scripts
# verify $SPECTRAL_PUBLISH_LOGIN and $SPECTRAL_PUBLISH_PASSWORD are set