前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >VScode本地进行Jenkinsfile语法验证

VScode本地进行Jenkinsfile语法验证

作者头像
DevOps云学堂
发布2022-12-29 17:12:31
1K0
发布2022-12-29 17:12:31
举报
文章被收录于专栏:DevOps持续集成DevOps持续集成

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.

Install Plugin (安装插件)

image.png

Plugin Settings (插件设置)

image.png

This extension contributes the following settings:

  • jenkins.pipeline.linter.connector.url: Url of the Jenkins Pipeline Linter.
  • jenkins.pipeline.linter.connector.crumbUrl: Url of the Jenkins Crumb Issuer.
  • jenkins.pipeline.linter.connector.pass: Jenkins password (can be left blank if you don't want to put your password in your settings).
  • jenkins.pipeline.linter.connector.token: Jenkins token (can be left blank if you don't want to put your token in your settings).
  • jenkins.pipeline.linter.connector.user: Jenkins username.
  • jenkins.pipeline.linter.connector.strictssl: Set to false to allow invalid ssl connections.

Example:

Write Jenkinsfile

run Command Palette

click Validate Jenkinsfile

Get run result:


本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2022-11-11,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 DevOps云学堂 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • VScode Plugin 插件
  • Install Plugin (安装插件)
  • Plugin Settings (插件设置)
  • Write Jenkinsfile
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档