<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Judith Pivoteau</title>
    <description>The latest articles on DEV Community by Judith Pivoteau (@juunp).</description>
    <link>https://dev.to/juunp</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3622%2FeRpB4tys.jpg</url>
      <title>DEV Community: Judith Pivoteau</title>
      <link>https://dev.to/juunp</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/juunp"/>
    <language>en</language>
    <item>
      <title>Jenkins Pipeline, succinct presentation</title>
      <dc:creator>Judith Pivoteau</dc:creator>
      <pubDate>Tue, 17 Apr 2018 14:38:47 +0000</pubDate>
      <link>https://dev.to/juunp/jenkins-pipeline-succinct-presentation-1g1n</link>
      <guid>https://dev.to/juunp/jenkins-pipeline-succinct-presentation-1g1n</guid>
      <description>&lt;p&gt;To access to the pipeline possibilities, you need to create a project with the pipeline default type.&lt;/p&gt;

&lt;p&gt;Pipeline code must start by &lt;code&gt;Pipeline {}&lt;/code&gt;&lt;br&gt;
Into this, we can define stages like this: &lt;code&gt;stage('NameOfStage') {}&lt;/code&gt;&lt;br&gt;
And into these stages, we can define multiple steps like this: &lt;code&gt;steps {}&lt;/code&gt;&lt;br&gt;
Commands go into the steps. Before the stages, you should add an &lt;a href="https://jenkins.io/doc/book/pipeline/syntax/#agent"&gt;agent&lt;/a&gt; to let know Jenkins where to run and other configurations like &lt;a href="https://jenkins.io/doc/book/pipeline/syntax/#post"&gt;post&lt;/a&gt; (defines other operations to come after the steps or stages) and &lt;a href="https://jenkins.io/doc/book/pipeline/syntax/#tools"&gt;tools&lt;/a&gt; (define the tool and put it on the &lt;code&gt;PATH&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;This matches a declarative pipeline;&lt;/p&gt;

&lt;p&gt;There is also scripted pipelines which starts by: &lt;code&gt;node {}&lt;/code&gt;&lt;br&gt;
Then, you can add stages to it but no steps. The code resides in the stages.&lt;/p&gt;

&lt;p&gt;A descriptive pipeline will checkout source code management (git) by itself before running anything contrary to a scripted one.&lt;/p&gt;

&lt;p&gt;In a descriptive pipeline, you can add a &lt;code&gt;script {}&lt;/code&gt; into a steps to execute some code otherwise, you are forced to use pre-formatted commands like &lt;code&gt;sh mvn --version&lt;/code&gt;, &lt;code&gt;echo Hello World!&lt;/code&gt;, etc.&lt;/p&gt;

&lt;p&gt;We must use the &lt;a href="http://groovy-lang.org/"&gt;Groovy language&lt;/a&gt; to code into a scripted pipeline (or the script block). Different Java libraries and &lt;a href="https://plugins.jenkins.io/"&gt;plugins&lt;/a&gt; may be added to Jenkins depending on needs.&lt;br&gt;
For example, to use the Double class, it should be added. I didn't know so I tried to build the project using it and once the build failed, I looked up the console log and saw a link to add the class. The link leads to a form when you can add or delete libraries. You can find this form in "Manage Jenkins" =&amp;gt; "In-process Script Approval".&lt;/p&gt;

&lt;p&gt;Some &lt;a href="https://wiki.jenkins.io/display/JENKINS/Building+a+software+project"&gt;Jenkins environment variables&lt;/a&gt; are also alvailable to use into the pipeline: &lt;code&gt;env.BUILD_NUMBER&lt;/code&gt; for example.&lt;/p&gt;

&lt;p&gt;Also, the code of the pipeline can be stored in a Jenkinsfile which will be commited to your project repository defining the continuous delivery process as part of the project.&lt;/p&gt;

</description>
      <category>jenkins</category>
      <category>pipeline</category>
      <category>deploy</category>
    </item>
  </channel>
</rss>
