|
@@ -13,6 +13,7 @@ def call(Map args = [:]) {
|
|
|
String profile = args.profile ?: env.PROFILE
|
|
String profile = args.profile ?: env.PROFILE
|
|
|
String jvmArgs = args.jvmArgs ?: env.JVM_ARGS ?: ''
|
|
String jvmArgs = args.jvmArgs ?: env.JVM_ARGS ?: ''
|
|
|
String remoteJar = "${remotePath}/${jarName}"
|
|
String remoteJar = "${remotePath}/${jarName}"
|
|
|
|
|
+ String javaCmd = args.javaCmd ?: env.JAVA_CMD ?: 'java'
|
|
|
|
|
|
|
|
PrintMes("开始发布 ${jarName} [profile=${profile}] 到 ${remoteHost}:${remotePort}", 'yellow')
|
|
PrintMes("开始发布 ${jarName} [profile=${profile}] 到 ${remoteHost}:${remotePort}", 'yellow')
|
|
|
|
|
|
|
@@ -76,7 +77,7 @@ def call(Map args = [:]) {
|
|
|
|
|
|
|
|
/* 4. 启动新进程 */
|
|
/* 4. 启动新进程 */
|
|
|
PrintMes("→ 4. 启动新进程 (profile=${profile})", 'yellow')
|
|
PrintMes("→ 4. 启动新进程 (profile=${profile})", 'yellow')
|
|
|
- sh """ssh -o StrictHostKeyChecking=no ${remoteHost} "sh -c 'cd ${remotePath} && nohup java ${jvmArgs} -jar ${jarName} --spring.profiles.active=${profile} > server.log 2>&1 &'" """
|
|
|
|
|
|
|
+ sh """ssh -o StrictHostKeyChecking=no ${remoteHost} "sh -c 'cd ${remotePath} && nohup ${javaCmd} ${jvmArgs} -jar ${jarName} --spring.profiles.active=${profile} > server.log 2>&1 &'" """
|
|
|
PrintMes("√ 4. 新进程启动命令已发送", 'green')
|
|
PrintMes("√ 4. 新进程启动命令已发送", 'green')
|
|
|
|
|
|
|
|
|
|
|