简体   繁体   中英

Jenkins execute bash shell command

Hello all I have build an CI server by jenkins. I want to execute remote bash shell on testing server (Ubuntu server 12.04 LTTS) by this sample script through ssh plugin

#!/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;

But the servicemix can not start, if I do manually ssh login from bash shell, then execute this script (stored in test server) it can work well. Any Idea for this. Thank you

I have resolve this. This is error failed load JAVA_HOME from script. Actually this run on different shell configuration environment that have not load configuration from my .profile. – TienHoang

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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