Bootstrap

VScode本地进行Jenkinsfile语法验证

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 Plugin 插件

VScode是一款应用广泛且功能强大的开发人员编辑器。我们通常使用VScode来开发Jenkinsfile。对Jenkinsfile进行本地检查,需要安装Jenkins Pipeline Linter Connector插件。该插件的工作原理是调用远程的Jenkins API /pipeline-model-converter/validate.
adcb770ced4b22fe1acc51cf022a086c.jpeg

Install Plugin (安装插件)

3dedb8f1f782a246cb6edc6c466ec5b6.png
image.png

Plugin Settings (插件设置)

悦读

道可道,非常道;名可名,非常名。 无名,天地之始,有名,万物之母。 故常无欲,以观其妙,常有欲,以观其徼。 此两者,同出而异名,同谓之玄,玄之又玄,众妙之门。

;