Last active
September 15, 2022 12:20
-
-
Save darkobits/edb29cf84e64d442cbf5d50832956860 to your computer and use it in GitHub Desktop.
Jenkins Interactive Shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
script { | |
while (true) { | |
def cmd = input(message: 'Jenkins Interactive Shell', parameters: [ | |
string(name: 'cmd', description: 'Enter a command or leave blank to continue job.', defaultValue: '') | |
], ok: 'Execute') | |
if (cmd == '') { print 'Continuing job...'; break; } | |
try { sh cmd } catch (err) { } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Very nice!
The Jenkins Pipeline Utilities library by ebay provides steps similar to this one, mainly:
interactiveShell
interactiveGroovyShell