From the course: Intermediate Jenkins: Automate, Integrate, and Secure CI/CD Workflows at Scale

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Use the pipeline snippet generator

Use the pipeline snippet generator

As you're learning how to configure pipelines, it can be difficult to know how to write the code for a specific step along with any parameters or arguments that the step needs. Fortunately, Jenkins provides built-in tools to help us along the way. You can find these tools in the Pipeline Syntax page. When you're editing a pipeline job configuration, there's a link labeled Pipeline Syntax just below the Pipeline Configuration field. the link opens the Pipeline Syntax page in a new tab where we can access the Snippet Generator. There is also a Directive Generator and some additional documentation that you may want to review. For now, let's focus on the Snippet Generator. The selector under Sample Step lists all the basic steps we can use with the Snippet Generator. There are plenty to choose from, but for now I'll just stick with Archive Artifacts. In this dialog, I can enter all the parameters that get passed to the step. For example, I want to archive any files ending in .txt that…

Contents