doc/editor_extensions/visual_studio_code/cicd.md
{{< details >}}
{{< /details >}}
{{< history >}}
{{< /history >}}
If your project uses GitLab CI/CD pipelines, you can use the GitLab for VS Code extension to start, monitor, and update pipelines directly in your IDE.
Use the extension to monitor and manage pipelines for your project.
Prerequisites:
To view the status of your branch pipeline, check the bottom status bar in VS Code.
Possible statuses include:
To start, monitor, and debug CI/CD pipelines in GitLab:
In VS Code, in the bottom status bar, select the pipeline status to open the Command Palette and access the available actions.
Select your desired action and follow the prompts:
To view the output for a CI/CD job for your current branch:
In the left sidebar, select GitLab ({{< icon name="tanuki" >}}).
Expand For current branch to view the most recent pipeline.
Select a job to open it in a new VS Code tab:
To open a downstream pipeline's job log:
The extension can display an alert in VS Code when a pipeline for your current branch completes:
To turn pipeline alerts on or off:
The extension also provides tools you can use to create and manage the CI/CD configuration for your project.
When you write or edit your CI/CD configuration file, use variable autocompletion to find variables quickly.
Prerequisites:
.gitlab-ci and ends with .yml or .yaml.
For example, .gitlab-ci.yml or .gitlab-ci.production.ymlTo autocomplete a variable:
In VS Code, open your .gitlab-ci.yml file, and ensure the file's tab is in focus.
Begin entering the variable name. The extension displays autocomplete options.
Select an option to use it:
To test your project's GitLab CI/CD configuration locally:
.gitlab-ci.yml file, and ensure the file's tab is in focus.GitLab: Validate GitLab CI Config and press <kbd>Enter</kbd>.The extension shows an alert if it detects a problem with your configuration.
To see a preview of your merged CI/CD configuration file, with all includes and references resolved:
In VS Code, open your .gitlab-ci.yml file, and ensure the file's tab is in focus.
In the upper right, select Show Merged GitLab CI/CD Configuration:
VS Code opens a new tab (.gitlab-ci (Merged).yml) with full information.