Details
-
Type:
Bug
-
Status: Reopened (View Workflow)
-
Priority:
Major
-
Resolution: Unresolved
-
Component/s: pipeline
-
Labels:None
-
Similar Issues:
Description
Looking at the documentation at
https://www.jenkins.io/doc/book/pipeline/
It's impossible to know:
- How to run a shell script.
- How to copy files and folders around. Possibly using wildcards in shell scripts.
- How to delete a directory.
Trying to find out how to do these simple things resulted in a waste of time. Google didn't help either.
You may probably want to add some simple examples explaining how to do simple tasks (copying files, creating zip files, etc.), what "Jenkins plugins" are, which are the most frequently used ones.
Documentation says:
sh is a Pipeline step (provided by the Pipeline: Nodes and Processes plugin) that executes the given shell command.
But then following the link to the "Pipeline: Nodes and Processes"
https://plugins.jenkins.io/workflow-durable-task-step/
the user is miserably abandoned with no documentation at all on how to run a process. This in turn results in thousands of wasted hours around the globe.
For example, it would be interesting to know that in the following excerpt:
sh 'make test'
The 'make test' string is not the script you want to execute, but the Groovy string representation of the script, which is quite a different beast.
Since this is not documented there, people document it elsewhere, usually after hours and hours of experimentation, accidental file deletion and wasted computing resources. For an example see
https://gist.github.com/Faheetah/e11bd0315c34ed32e681616e41279ef4