Используя плагин sshPublisher Jenkins Pipeline ("опубликовать поверх 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
}
На вики-странице здесь написано (хотя это старое и с 2011 года):
STDOUT и STDERR из выполнения команды записываются в консоли Jenkins.