From 7cb5959fe6a6b6a46cf1e3947aff0f4bb343d018 Mon Sep 17 00:00:00 2001
From: orgin <feixingyuanup@gmail.com>
Date: Thu, 11 May 2023 19:11:40 +0800
Subject: [PATCH] =?UTF-8?q?fix:Jenkinsfile=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 Jenkinsfile | 75 ++++++++++++-----------------------------------------
 1 file changed, 16 insertions(+), 59 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 5dac97fb..1af72b5d 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,69 +1,26 @@
-// pipeline {
-//     agent any
-//     stages {
-//         stage('Stop') {
-//             steps {
-//                 sh '/var/lib/jenkins/workspace/stop.sh'
-//             }
-//         }
-//         stage('Build') {
-//             steps {
-//                 sh 'mvn -B -DskipTests clean install'
-//             }
-//         }
-//         stage('Start'){
-//             steps {
-//                 sh '/var/lib/jenkins/workspace/start.sh'
-//             }
-//         }
-// //         stage('Deploy') {
-// //             steps {
-// //                 sh 'echo publish'
-// //             }
-// //         }
-//     }
-// }
-
 pipeline {
     agent any
-
-    parameters{
-        //choice(choices:"master", description:"请填写git分支",name:"branch")
-        string(defaultValue:"jeecg-system-start-3.5.1.jar", description:"jar包名称",name:"jarName")
-        string(defaultValue:"alysisSystemForRadionuclide", description:"项目名称",name:"projectName")
-        string(defaultValue:"/home/zhaohy/test/expect_scp", description:"expect_scp可运行脚本地址",name:"expectScpPath")
-        string(defaultValue:"/home/zhaohy/test/expect_ssh", description:"expect_ssh可运行脚本地址",name:"expectSsh")
-        string(defaultValue:"192.168.0.115", description:"scp发送文件的服务器地址",name:"scpHost")
-        string(defaultValue:"zhaohy", description:"scp发送服务器的用户名",name:"scpUserName")
-        password(defaultValue:"password", description:"scp发送服务器的密码",name:"scpPwd")
-        string(defaultValue:"/home/zhaohy/tmp/", description:"scp发送服务器的目标路径",name:"scpTargetPath")
-    }
-
-
-    stages() {
-        stage('打包') {
+    stages {
+        stage('Stop') {
             steps {
-                sh "pwd"
-                sh "mvn clean package -Dmaven.test.skip=true"
+                sh '/var/lib/jenkins/workspace/stop.sh'
             }
         }
-//         stage('部署') {
+        stage('Build') {
+            steps {
+                sh 'mvn -B -DskipTests clean install'
+            }
+        }
+        stage('Start'){
+            steps {
+                sh '/var/lib/jenkins/workspace/start.sh'
+            }
+        }
+//         stage('Deploy') {
 //             steps {
-//                 sh "pwd"
-//                 sh "cd ${params.projectName}/ && ${params.expectScpPath} ${params.scpHost} ${params.scpUserName} ${params.scpPwd} target/*.jar ${params.scpTargetPath}"
+//                 sh 'echo publish'
 //             }
 //         }
-//         stage('备份') {
-//             steps {
-//                sh "${params.expectSsh} ${params.scpHost} ${params.scpUserName} ${params.scpPwd} \'cd ${params.scpTargetPath};cp ${params.jarName} backup/${params.projectName}_\$(date +%F-%T).jar\'"
-//             }
-//          }
-         stage('重启') {
-            steps {
-                sh "pid=\$(ps -ef|grep $jarName |egrep -v grep|awk '{print \$2}');kill -9 \$pid;nohup java -jar ${params.jarName} >/dev/null 2>&1 &"
-            }
-         }
     }
-
-
 }
+