[JIRA] (JENKINS-44847) add functionality to pipeline

1 view
Skip to first unread message

o.v.nenashev@gmail.com (JIRA)

unread,
Feb 22, 2018, 10:06:04 AM2/22/18
to jenkinsc...@googlegroups.com
Oleg Nenashev assigned an issue to Unassigned
 

Dean does not work on this plugin. I am also stepping down as maintainer, so the plugin is up for adoption

Jenkins / New Feature JENKINS-44847
add functionality to pipeline
Change By: Oleg Nenashev
Assignee: Dean Yu
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

jglick@cloudbees.com (JIRA)

unread,
Oct 10, 2019, 10:10:10 AM10/10/19
to jenkinsc...@googlegroups.com
Jesse Glick updated an issue
Change By: Jesse Glick
Labels: pipeline
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

jglick@cloudbees.com (JIRA)

unread,
Oct 10, 2019, 10:25:03 AM10/10/19
to jenkinsc...@googlegroups.com
Jesse Glick commented on New Feature JENKINS-44847
 
Re: add functionality to pipeline

More broadly, we strongly encourage users to minimize the number of distinct steps in a Pipeline build, so that

node {
  stage('Checkout') {
    checkout scm
  }
  stage('Build') {
    sh 'mvn -DskipTests package'
  }
  stage('Test') {
    sh 'mvn surefire:test'
  }
}

should be reduced to

node {
  stage('Checkout') {
    checkout scm
  }
  stage('Main') {
    sh 'mvn package'
  }
}

or even moving the details to an external versioned file in whatever language is most convenient, so that the Pipeline script itself stays short enough to not need testing or frequent patching:

node {
  stage('Checkout') {
    checkout scm
  }
  stage('Main') {
    sh 'bash ci.sh'
  }
}

(For now, the checkout cannot be easily moved to an external script, since Jenkins SCM plugins do some complex things with authentication, PR merging, changelog generation, and polling which are tricky to replace with a plain git clone, not to mention that you need to bootstrap a checkout just to get an external script to run!)

The problem is that when you do this, you lose some richness of detail in build visualizations. From the text console, this is not so visible, but from Blue Ocean it is. In this case, you lose the ability to see quickly which “stage” the build is in, even if ci.sh is running multiple long-running subcommands. What we would like is for your ci.sh to look something like

echo === Building
mvn -DskipTests package
echo === Testing
mvn surefire:test

where the visualization layers would automatically pick up the section headers (you could also use https://en.wikipedia.org/wiki/Page_break etc.) and display them just like stage or other labels present in Pipeline script. (Delimiters could even be made to match built-in output of various build tools. For example using [INFO] --- would allow a one-line script mvn test to show structure in the Jenkins UI.)

Reply all
Reply to author
Forward
0 new messages