Generate Custom Code
In Jenkins, we have collected common or frequently used codes (XML, Pipeline) when creating jobs and displayed a list for ease of use so that it is easy to reuse. You can also register and use your own code.
For convenient use, enter Generate Custom Job Code in the Command Palette and use it easily through [Ctrl + Shift + Insert].
Generate Custom Code
In the extension, you can see both the registered code and the code that you are registered with.
- The icon is separated so that it is easier for the user to see the registered code and the registered code in the extension.
Register a custom code file
If you select the settings icon in the Snippet Tree View, the Settings screen will be displayed in the editor window, and then find Snippet.custom-file and enter the full path of the file in your directory.
- The writing guide will be written separately.
Creation Snippet Code
After you find the code you want to use in the Snippet Tree View, select the + icon at the very end and it will be copied to the editor.
- In the image at the bottom, the Jenkins Language Mode is on the left and the XML Language Mode is on the right.
After you’re done, type ExecuteQuick or use the shortcut [Alt+Shift+Enter] in the Command Palette for quick execution.
- ExecuteQuick behaves differently depending on the Language Mode (see the red part in the lower right corner of the image below).
- XML: Create a Job or make changes [Execute Job (Ctrl+K F4)]
- Groovy: Validate Jenkinsfile [Validate Jenkinsfile (Ctrl+Alt+T)]