Jenkins 2 Pipelines - How to model a continuous delivery pipeline
<p>I am completely new to Jenkins 2 pipelines. </p>

<p>I had played with Jenkins 1 pipelines with the following view:</p>

<p><a href="https://i.stack.imgur.com/nQpYh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nQpYh.png" alt="enter image description here"></a></p>

<p>You could start a certain stage directly, let's say that I could choose to start running from the release stage, skipping Test.</p>

<p>I have a pretty simple Jenkins 2 pipeline definition:</p>

<pre><code>stage('Preparation'){
    echo """
         Preparing
         something
         """
}
stage('Greeting') { 
    parallel 'hello1':{
        node{
            echo 'hello world 1'
        }
    }, 'hello2':{
        node{
            echo 'hello world 2'
        }
    }
}
</code></pre>

<p>In the pipeline page I have "Build now" which runs all stages starting from Preparation.</p>

<p>My questions are:</p>

<ol>
<li>How can I run the stage I prefer? For instance Greeting instead of starting from Preparation?</li>
<li>How do you define the dependencies between stages? I mean the stage called after another one completes</li>
<li>Is there a way to limit the stages that a certain user can start? Imagine that I only want a specific user to launch the Greeting stage.</li>
<li>How do you setup manual stages?</li>
</ol>

<p><strong>UPDATE:</strong> The real goal behind my questions is the modelling of a <strong>continuous delivery pipeline</strong> like the following with <strong>Jenkins 2 pipelines</strong>:</p>

<pre><code>Build stage --&gt; AUTO --&gt; Acceptance Stage --&gt; MANUAL --&gt; Production Stage
                                          --&gt; MANUAL --&gt; QA Stage
</code></pre>

<p>This is the behaviour I want:</p>

<p><strong>Build Stage</strong> (any user can start it) when it finishes it triggers automatically the <strong>Acceptance Stage</strong>. This one can't be lauched manually, only automatically after succesfully finishing the Build Stage.</p>

<p>From <strong>Acceptance Stage</strong> I need that only authorized users can manually trigger <strong>QA Stage</strong> and <strong>Production Stage</strong>.</p>

<p>The business flow would be: a developer hits Build Stage, its code is built and packaged. Acceptance Stage begins, using the packaged code to run a bunch of automated tests.</p>

<p>At this point, when Acceptance Stage has finished OK, two things can happen:</p>

<ol>
<li>Maybe QA Stage is needed to run more tests (Cucumber, manual, etc.). Some some authorized user would fire this stage.</li>
<li>When the product owner is happy, he can decice to launch the Production Stage to deploy the code in a production environment.</li>
</ol>

<p>I am struggling to model this with Jenkins 2 pipelines.</p>