Jenkins Pipeline - how are 'sh' steps named in blue ocean?
Asked Answered
A

2

5

I'm not following how the 'sh' step name or description is displayed in blue ocean. Right now, it's seemingly at random.

example...

This sh step shows 'Shell Script' in the step description:

sh "cp -r /some/path/external/to/workspace/root ."

And this one shows the actual command that's running:

sh "cp -r somedir/dir somedir/file.sh somedir/makefile ."

At first I thought it was copying from a path external to the workspace root to inside of it, but that seems to have no bearing as later in my build I copy files from outside of the workspace root and the command is displayed.

Any ideas? Any workarounds on how to make the description step something sane? I've found a few issues in the Jenkins project regarding this, but none have been fixed yet or contain workarounds.

Ambala answered 1/11, 2017 at 14:10 Comment(1)
A link to those issues you mention would be nice.Bipartite
M
6

In case anyone sees this years later:

The documentation mentions an optional label parameter. Thus, the answer is:

sh(script: "cp -r somedir/dir somedir/file.sh somedir/makefile .", label: "Copying Stuff")
Mustang answered 10/1, 2020 at 9:59 Comment(1)
While being helpful it doesn't answer the question. Label still appear seeming randomly.Notary
M
0

I think this is a bug in workflow-durable-task-step-plugin. We're experiencing the same issue in lower versions of the plugin, but not in higher ones.

My guess is that this is the fix: https://github.com/jenkinsci/workflow-durable-task-step-plugin/commit/75c3f9b514d3c836e5862605e8991e7979153590 So the plugin shouldn't have this issue for versions later than 2.40.

Mchale answered 22/2 at 8:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.