繁体   English   中英

Jenkins 执行 bash shell 命令

[英]Jenkins execute bash shell command

大家好,我已经建立了 jenkins 的 CI 服务器。 我想通过此示例脚本通过 ssh 插件在测试服务器(Ubuntu 服务器 12.04 LTTS)上执行远程 bash shell

#!/bin/bash
cd "$(dirname "$0")"

echo "[INFO] Stopping service mix service"
cd /home/setup/Development/apache-servicemix-4.5.0/bin
./stop
echo "[INFO] Wait few secs for stopping service"
sleep 5
echo "[INFO] Start service"
./start
sleep 1
exit;

但是servicemix无法启动,如果我从bash shell手动ssh登录,然后执行这个脚本(存储在测试服务器中)它可以正常工作。 对此有任何想法。 谢谢

我已经解决了这个问题。 这是从脚本加载 JAVA_HOME 失败的错误。 实际上这运行在不同的 shell 配置环境中,这些环境没有从我的 .profile 加载配置。 – 天煌

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM