Reputation: 1586
I am pretty new to Jenkins and its plugins. I managed to setup a declarative pipeline job on my Jenkins server. The pipeline stage view is a bit strange.
There is a gap between the first stage and the left-hand side panel.
There are extra stages as Declarative Checkout SCM
, Declarative Agent Setup
and Declarative Post Actions
being displayed, which are not part of my Jenkinsfile. Can I hide these stages and only show stages in my Jenkinsfile?
Here is the version info of my configuration:
pipeline-stage-view Pipeline: Stage View Plugin 2.10
pipeline-stage-step Pipeline: Stage Step 2.3
pipeline-stage-tags-metadata Pipeline: Stage Tags Metadata 1.3.7
simple-theme 0.5.1
jenkins version 2.164.1
I also use the neo2 theme via the simple-theme plugin
Update 1 Disabling the simple-theme plugin made NO difference
Upvotes: 3
Views: 2765
Reputation: 1586
I figured out the source of these extra steps and how to get rid of them by change your Jenkinsfile.
Originally my Jenkinsfile looks like
pipeline {
agent { dockerfile true } // causes the "Declarative Agent Setup" stage
options {
ansiColor('xterm')
}
stages {
...
}
post { // causes the "Declarative Post Actions" stage
...
}
}
The Declarative Checkout SCM
is the default behaviour when you configure your pipeline to use Pipeline script from SCM
.
After I updated my Jenkins file to
pipeline {
agent { label 'docker' } // Not using dockerfile directly to prepare the agent
options {
ansiColor('xterm')
skipDefaultCheckout() // removes the "Declarative Checkout SCM" stage
}
stages {
stage ('Checkout') {
checkout scm
}
}
post { // causes the "Declarative Post Actions" stage
...
}
}
I managed to get rid of Declarative Agent Setup
and Declarative Checkout SCM
Still no idea about how to fix the Gap
Upvotes: 2