使用Jenkins Pipeline's sshPublisher plugin(“通过ssh发布”),是否可以获得使用execCommand
运行的命令的退出代码和输出(在工件被传输之后)?
我使用的插件如下:
script {
echo "Sending artifacts to machine at " + remoteDirectory
// Use of the ssh publisher plugin over SSH
sshPublisher(
failOnError: false,
publishers: [
sshPublisherDesc(
configName: "my-drive",
transfers: [
sshTransfer(
sourceFiles: mySourceFilesList,
remoteDirectory: remoteDirectory,
flatten: true,
execCommand: commandToExec,
execTimeout: 1800000
)
],
sshRetry: [
retries: 0
]
)
]
)
// How can I get the output of execCommand?
// If the exit code was 1, I want to perform some special steps
// I'd also like to include the output of the command in these steps
}
字符串
维基页面here说(这是旧的,从2011年虽然):
命令执行的STDOUT和STDERR记录在Jenkins控制台中。
1条答案
按热度按时间fhg3lkii1#
这是一个“不”(不能肯定,但我尝试了一切我可以)。
现在我对这个剧本很满意
字符串