What is the difference between a node, stage, and step in Jenkins pipelines? : <p>I'm trying to understand how to structure my Jenkins 2.7 pipeline groovy script.  I've read through the <a href="https://github.com/jenkinsci/pipeline-plugin/blob/master/TUTORIAL.md" rel="noreferrer">pipeline tutorial</a>, but feel that it could expand more on these topics.</p>

<p>I can understand that a pipeline can have many <code>stage</code>s and each <code>stage</code> can have many <code>step</code>s.  But what is the difference between a <code>step();</code> and a method call inside a <code>stage</code>, say <code>sh([script: "echo hello"]);</code>.  Should <code>node</code>s be inside or outside of <code>stage</code>s?  Should the overall properties of a job be inside or outside a <code>node</code>?</p>

<p>Here is my current structure on an ubuntu master node:</p>

<pre><code>#!/usr/bin/env groovy

node('master') {
    properties([
        [$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', numToKeepStr: '10']]
    ]);

    stage 'Checkout'
        checkout scm

    stage 'Build'
        sh([script: "make build"]);

    archive("bin/*");
}
</code></pre>
