luhaowen 3 tygodni temu
rodzic
commit
5e38e836b0
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      vars/deployJar.groovy

+ 2 - 2
vars/deployJar.groovy

@@ -21,11 +21,11 @@ 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 &'"
+        sh "ssh -o StrictHostKeyChecking=no ${remoteHost} 'cd ${remotePath} && nohup java -jar ${jarName} --spring.profiles.active=${profile} > server.log 2>&1  </dev/null &'"
 
         PrintMes("发布成功 ${jarName}", 'green')
     } catch (Exception e) {
         PrintMes("发布失败 ${jarName} : ${e.message}", 'red')
-        error('deploySpringBoot failed')   // 让流水线整体失败
+        error('deploySpringBoot failed')
     }
 }