background(背景) Pipeline As Code is a core feature of Jenkins2.0. Not only learn the pipeline syntax, we also had to do a local basic syntax check on each Jenkinsfile commit to git repo. Pipeline As Code 是Jenkins的核心特性。我们不仅要学习Pipeline语法,还要对每次提交的Jenkinsfile进行本地基本语法检查。
VScode是一款应用广泛且功能强大的开发人员编辑器。我们通常使用VScode来开发Jenkinsfile。对Jenkinsfile进行本地检查,需要安装Jenkins Pipeline Linter Connector
插件。该插件的工作原理是调用远程的Jenkins API /pipeline-model-converter/validate
.
image.png
image.png
This extension contributes the following settings:
Example:
run Command Palette
click Validate Jenkinsfile
Get run result: