user797963
user797963

Reputation: 3027

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

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.

Upvotes: 5

Views: 1853

Answers (2)

yonSon
yonSon

Reputation: 3

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.

Upvotes: 0

MCO
MCO

Reputation: 1257

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")

Upvotes: 6

Related Questions