如何通过ssh执行shell脚本?

如何通过ssh执行shell脚本?

我正在尝试通过 ssh 在远程服务器上安装 opentelemtry 包。实际上我从 github actions 执行脚本(使用下面的命令)。如果我在服务器上运行相同的脚本,它的工作正常,但从 github 操作在某些时候它会进入挂起状态(长时间进行状态),直到 github 操作的最大构建时间(2小时13分钟),然后进入失败状态。其他脚本正在完全执行,但 github actions 作业没有进入完成状态。请让我知道我能做什么?使用下面的命令在 github actions 上远程执行脚本 run: ssh -o StrictHostKeyChecking=no -i .id_rsa root@$IPaddress "sh /root/script"

脚本文件

cd /usr/ports/edjx-freebsd-ports/opentelemetry-collector
make clean
make deinstall
make makesum
make gomod-vendor
make install

相关内容