debian-mirror-gitlab/doc/ci/lint.md

56 lines
2.2 KiB
Markdown
Raw Normal View History

2021-01-29 00:20:46 +05:30
---
2021-03-11 19:13:27 +05:30
stage: Verify
group: Pipeline Authoring
2021-02-22 17:27:13 +05:30
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
2021-01-29 00:20:46 +05:30
---
2021-11-11 11:23:49 +05:30
2022-04-04 11:22:00 +05:30
# Validate GitLab CI/CD configuration **(FREE)**
2020-10-24 23:57:45 +05:30
2022-04-04 11:22:00 +05:30
Use the CI Lint tool to check the validity of GitLab CI/CD configuration.
You can validate the syntax from a `.gitlab-ci.yml` file or any other sample CI/CD configuration.
This tool checks for syntax and logic errors, and can simulate pipeline
creation to try to find more complicated configuration problems.
2020-10-24 23:57:45 +05:30
2022-04-04 11:22:00 +05:30
If you use the [pipeline editor](pipeline_editor/index.md), it verifies configuration
syntax automatically.
2020-10-24 23:57:45 +05:30
2022-04-04 11:22:00 +05:30
If you use VS Code, you can validate your CI/CD configuration with the
2021-12-11 22:18:48 +05:30
[GitLab Workflow VS Code extension](../user/project/repository/vscode.md).
2022-04-04 11:22:00 +05:30
## Check CI/CD syntax
2020-10-24 23:57:45 +05:30
2022-04-04 11:22:00 +05:30
The CI lint tool checks the syntax of GitLab CI/CD configuration, including
configuration added with the [`includes` keyword](yaml/index.md#include).
2020-10-24 23:57:45 +05:30
2022-04-04 11:22:00 +05:30
To check CI/CD configuration with the CI lint tool:
2020-10-24 23:57:45 +05:30
2022-04-04 11:22:00 +05:30
1. On the top bar, select **Menu > Projects** and find your project.
2022-05-07 20:08:51 +05:30
1. On the left sidebar, select:
2022-04-04 11:22:00 +05:30
- **CI/CD > Pipelines**
1. In the top right, select **CI lint**.
1. Paste a copy of the CI/CD configuration you want to check into the text box.
1. Select **Validate**.
2020-10-24 23:57:45 +05:30
2022-04-04 11:22:00 +05:30
## Simulate a pipeline
2020-10-24 23:57:45 +05:30
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/229794) in GitLab 13.3.
2022-04-04 11:22:00 +05:30
You can simulate the creation of a GitLab CI/CD pipeline to find more complicated issues,
including problems with [`needs`](yaml/index.md#needs) and [`rules`](yaml/index.md#rules)
configuration. A simulation runs as a Git `push` event on the default branch.
2020-10-24 23:57:45 +05:30
2022-04-04 11:22:00 +05:30
Prerequisites:
2020-10-24 23:57:45 +05:30
2022-04-04 11:22:00 +05:30
- You must have [permissions](../user/permissions.md#project-members-permissions)
to create pipelines on this branch to validate with a simulation.
2020-10-24 23:57:45 +05:30
2022-04-04 11:22:00 +05:30
To simulate a pipeline:
2020-10-24 23:57:45 +05:30
2022-04-04 11:22:00 +05:30
1. On the top bar, select **Menu > Projects** and find your project.
2022-05-07 20:08:51 +05:30
1. On the left sidebar, select:
2022-04-04 11:22:00 +05:30
- **CI/CD > Pipelines**
1. In the top right, select **CI lint**.
1. Paste a copy of the CI/CD configuration you want to check into the text box.
1. Select **Simulate pipeline creation for the default branch**.
1. Select **Validate**.