luhaowen 3 周之前
父節點
當前提交
b709ad0914
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      vars/deployJar.groovy

+ 1 - 1
vars/deployJar.groovy

@@ -21,7 +21,7 @@ def call(Map args = [:]) {
         sh "scp -o StrictHostKeyChecking=no ${jarPath} ${remoteHost}:${remoteJar}"
 
         /* 4. 启动新服务 */
-        sh "ssh -o StrictHostKeyChecking=no ${remoteHost} 'cd ${remotePath} && nohup java -jar ${jarName} --spring.profiles.active=${profile} > server.log 2>&1  </dev/null & disown'"
+        sh ''' ssh -o StrictHostKeyChecking=no ${remoteHost} "sh -c 'cd ${remotePath} && nohup java -jar ${jarName} --spring.profiles.active=${profile} > server.log 2>&1  </dev/null &'" '''
 
         PrintMes("发布成功 ${jarName}", 'green')
     } catch (Exception e) {