<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Jenkinsfile on Sandro Cirulli</title>
    <link>https://sandrocirulli.net/tags/jenkinsfile/</link>
    <description>Recent content in Jenkinsfile on Sandro Cirulli</description>
    <generator>Hugo</generator>
    <language>en-gb</language>
    <lastBuildDate>Wed, 16 Oct 2019 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://sandrocirulli.net/tags/jenkinsfile/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>How to Validate a Jenkinsfile</title>
      <link>https://sandrocirulli.net/how-to-validate-a-jenkinsfile/</link>
      <pubDate>Wed, 16 Oct 2019 00:00:00 +0000</pubDate>
      <guid>https://sandrocirulli.net/how-to-validate-a-jenkinsfile/</guid>
      <description>&lt;figure&gt;&lt;img src=&#34;../../img/pipeline-parallel-stages-e1566145513114.png&#34;&#xA;    alt=&#34;Jenkins Pipeline Parallel Stages&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;&#xA;          &lt;a href=&#34;https://www.jenkins.io/blog/2017/09/25/declarative-1/&#34;&gt;Image: jenkins.io ©&lt;/a&gt;&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;As I’m using more and more often &lt;a href=&#34;https://jenkins.io/doc/book/pipeline/&#34;&gt;Jenkins Pipelines&lt;/a&gt;, I found the need to validate a Jenkinsfile in order to fix syntax errors before committing the file into version control and running the pipeline job in Jenkins. This can saves some time during development and allows to follow best practices when writing a Jenkinsfile as validation returns both errors and warnings.&lt;/p&gt;&#xA;&lt;p&gt;There are &lt;a href=&#34;https://jenkins.io/doc/book/pipeline/development/#linter&#34;&gt;several ways to validate a Jenkinsfile&lt;/a&gt; and some editors like VS Code even have a &lt;a href=&#34;https://jenkins.io/blog/2018/11/07/Validate-Jenkinsfile/&#34;&gt;built-in linter&lt;/a&gt;. Personally, the easiest way I found is to validate a Jenkinsfile is to run the following command from the command line (provided you have Jenkins running somewhere):&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
