问题描述

 jenkins配置好项目后,使用Publish over SSH插件推送到服务器指定目录的时候报错。

Console Output报错信息:ERROR: Exception when publishing, exception message [Exec exit status not zero. Status

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  48.400 s
[INFO] Finished at: 2023-04-14T09:33:24Z
[INFO] ------------------------------------------------------------------------
SSH: Connecting from host [jenkins-6869f47d99-2fcgm]
SSH: Connecting with configuration [containerd master] ...
SSH: EXEC: completed after 201 ms
SSH: Disconnecting configuration [containerd master] ...
ERROR: Exception when publishing, exception message [Exec exit status not zero. Status [127]]
Build step 'Send build artifacts over SSH' changed build result to UNSTABLE
Finished: UNSTABLE

原因分析

[127]代表的意思是没有找到执行文件的目录,那么把执行文件配对了就能解决。

解决办法

我当前的Publish over SSH插件配置如下:

修改后的配置:

重新build之后成功!

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  45.924 s
[INFO] Finished at: 2023-04-14T09:47:04Z
[INFO] ------------------------------------------------------------------------
SSH: Connecting from host [jenkins-6869f47d99-2fcgm]
SSH: Connecting with configuration [containerd master] ...
SSH: EXEC: completed after 54,291 ms
SSH: Disconnecting configuration [containerd master] ...
SSH: Transferred 1 file(s)
Finished: SUCCESS

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐