The snippet generator

Another useful feature is the snippet generator. It is very hard to guess what syntax some steps expect and documentation is often missing or scattered. You are probably not even sure if a certain plugin is installed or not. This is where the snippet generator comes to the rescue. You can find a link to the snippet generator under the Use Groovy Sandbox checkbox in the project configuration or at the bottom of the left-hand side menu on a pipeline project page. Clicking any of those links takes you to a new page where you can select a step you want to use. You can then specify some options you want to use. You can then generate a code snippet and copy and paste it into your own code. For example, you can generate a snippet that will poll a Git repository using your credentials:

Additional plugins can add new steps that you can inspect in the snippet generator. Be careful though, there are some steps that fall under the - Advanced/Deprecated - category. Those are two very different things and you cannot tell them apart. The one you can and probably want to use, while the other is better not used. Personally, I try to avoid steps in this category altogether. A very weird design choice, but at least, you have been warned.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset