jenkins执行远程服务器命令返回code127解决办法
ERROR: Exception when publishing, exception message [Exec exit status not zero. Status [127]]jenkins 流水线执行远程脚本返回127 表明缺少可执行文件,确定文件的位置可写对了即可。
·
jenkins 流水线执行远程脚本返回127 错误
jenkisn [Pipeline] sshPublisher 链接远程服务器执行sh命令报错 Status [127]
[Pipeline] sshPublisher
SSH: Connecting from host [bc4322610b02]
SSH: Connecting with configuration [dev] …
SSH: EXEC: completed after 200 ms
SSH: Disconnecting configuration [dev] …
ERROR: Exception when publishing, exception message [Exec exit status not zero. Status [127]]
127 报错是找不到可执行的文件。
特意比对了下脚本:此处值写了 sshPublisher相关脚本
sshPublisher(publishers: [sshPublisherDesc(configName: 'dev',
transfers: [sshTransfer(cleanRemote: false, excludes: '',
execCommand: 'sh deploy.sh',
execTimeout: 120000,
flatten: false,
makeEmptyDirs: false,
noDefaultExcludes: false,
patternSeparator: '[, ]+',
remoteDirectory: '**/jenkins',
remoteDirectorySDF: false, removePrefix: '', sourceFiles: '**/**')], usePromotionTimestamp: false,
useWorkspaceInPromotion: false, verbose: false)])
修改 execCommand 命令的地址,设置为全局路径 就 ok了
修改后脚本:
sshPublisher(publishers: [sshPublisherDesc(configName: 'dev',
transfers: [sshTransfer(cleanRemote: false, excludes: '',
execCommand: 'sh /root/project/zeus/deploy.sh',
execTimeout: 120000,
flatten: false,
makeEmptyDirs: false,
noDefaultExcludes: false,
patternSeparator: '[, ]+',
remoteDirectory: '**/jenkins',
remoteDirectorySDF: false, removePrefix: '', sourceFiles: '**/**')], usePromotionTimestamp: false,
useWorkspaceInPromotion: false, verbose: false)])
更多推荐
已为社区贡献3条内容
所有评论(0)