From 9b6a0df81786855e2c36d7866c195fa7b6fb0e92 Mon Sep 17 00:00:00 2001 From: luozhun <2025254074@qq.com> Date: Thu, 31 Oct 2024 11:00:09 +0800 Subject: [PATCH 01/15] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E6=8E=A5=E5=85=A5Jenkins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- policeSecurityServer/Jenkinsfile | 43 +++++++++++++++++++ .../tree/AdministrativeDivisionTree.vue | 1 - 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 policeSecurityServer/Jenkinsfile diff --git a/policeSecurityServer/Jenkinsfile b/policeSecurityServer/Jenkinsfile new file mode 100644 index 0000000..44b8e19 --- /dev/null +++ b/policeSecurityServer/Jenkinsfile @@ -0,0 +1,43 @@ +pipeline { + agent any + tools { + jdk "jdk-17.0.11" + maven "apache-maven-3.8.8" + } + stages { + stage('拉取代码') { + steps { + echo '开始拉取代码' + checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[credentialsId: '3', url: 'http://175.6.124.250:3100/luozhun/policeSecurity.git']]) + echo '代码拉取成功' + } + } + stage('构建后台服务') { + steps{ + echo '开始构建后台服务' + sh 'cd /var/jenkins_home/workspace/policeSecurity/policeSecurityServer && mvn clean -DskipTests=true package -P prod' + echo '后台服务构建完成' + } + } + stage('ssh远程推送代码'){ + steps{ + echo '开始推送构建产物' + script{ + def remote = [:] + remote.name = 'serverRoot' + remote.host = '118.253.177.137:55555' + remote.allowAnyHosts = true + withCredentials([usernamePassword(credentialsId: '4', passwordVariable: 'password', usernameVariable: 'username')]) { + remote.user = "${username}" + remote.password = "${password}" + } + sshCommand remote: remote, command: 'pwd=$(pwd) echo "ssh连接成功!当前工作目录:$(pwd)"' + + sshCommand remote: remote, command: 'echo "将构建的server.jar发送到服务器..."' + sshPut remote: remote, from: '/var/jenkins_home/workspace/policeSecurity/policeSecurityServer/target/policeSecurityServer.jar', into: '/home/javaProject/policeSecurity/logs' + sshCommand remote: remote, command: 'echo "server.jar发送成功!"' + } + } + } + } +} \ No newline at end of file diff --git a/superManagement/src/components/tree/AdministrativeDivisionTree.vue b/superManagement/src/components/tree/AdministrativeDivisionTree.vue index a382f59..1ae99ef 100644 --- a/superManagement/src/components/tree/AdministrativeDivisionTree.vue +++ b/superManagement/src/components/tree/AdministrativeDivisionTree.vue @@ -5,7 +5,6 @@ :change-on-select="changeOnSelect" :options="administrativeDivisionTree" :load-data="loadData" - style="width: 500px" :allow-clear="allowClear" /> From ddc474d2d0b4b8911429472c7c2e120f09e5d916 Mon Sep 17 00:00:00 2001 From: luozhun <2025254074@qq.com> Date: Thu, 31 Oct 2024 11:03:00 +0800 Subject: [PATCH 02/15] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E6=8E=A5=E5=85=A5Jenkins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- policeSecurityServer/Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/policeSecurityServer/Jenkinsfile b/policeSecurityServer/Jenkinsfile index 44b8e19..6556f19 100644 --- a/policeSecurityServer/Jenkinsfile +++ b/policeSecurityServer/Jenkinsfile @@ -15,7 +15,7 @@ pipeline { stage('构建后台服务') { steps{ echo '开始构建后台服务' - sh 'cd /var/jenkins_home/workspace/policeSecurity/policeSecurityServer && mvn clean -DskipTests=true package -P prod' + sh 'cd /var/jenkins_home/workspace/警保联动后端服务/policeSecurityServer && mvn clean -DskipTests=true package -P prod' echo '后台服务构建完成' } } @@ -34,7 +34,7 @@ pipeline { sshCommand remote: remote, command: 'pwd=$(pwd) echo "ssh连接成功!当前工作目录:$(pwd)"' sshCommand remote: remote, command: 'echo "将构建的server.jar发送到服务器..."' - sshPut remote: remote, from: '/var/jenkins_home/workspace/policeSecurity/policeSecurityServer/target/policeSecurityServer.jar', into: '/home/javaProject/policeSecurity/logs' + sshPut remote: remote, from: '/var/jenkins_home/workspace/警保联动后端服务/policeSecurityServer/target/policeSecurityServer.jar', into: '/home/javaProject/policeSecurity/logs' sshCommand remote: remote, command: 'echo "server.jar发送成功!"' } } From 09b798dcd20b5b58b7b9e0e0966e94eb3b33e4fb Mon Sep 17 00:00:00 2001 From: luozhun <2025254074@qq.com> Date: Thu, 31 Oct 2024 11:06:20 +0800 Subject: [PATCH 03/15] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E6=8E=A5=E5=85=A5Jenkins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- policeSecurityServer/Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/policeSecurityServer/Jenkinsfile b/policeSecurityServer/Jenkinsfile index 6556f19..be9e6bf 100644 --- a/policeSecurityServer/Jenkinsfile +++ b/policeSecurityServer/Jenkinsfile @@ -25,7 +25,8 @@ pipeline { script{ def remote = [:] remote.name = 'serverRoot' - remote.host = '118.253.177.137:55555' + remote.host = '118.253.177.137' + remote.port = 55555 remote.allowAnyHosts = true withCredentials([usernamePassword(credentialsId: '4', passwordVariable: 'password', usernameVariable: 'username')]) { remote.user = "${username}" From 18ed54bdf2323c68cdad1b1539463d252a5da4f1 Mon Sep 17 00:00:00 2001 From: luozhun <2025254074@qq.com> Date: Thu, 31 Oct 2024 11:08:44 +0800 Subject: [PATCH 04/15] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E6=8E=A5=E5=85=A5Jenkins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- policeSecurityServer/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/policeSecurityServer/Jenkinsfile b/policeSecurityServer/Jenkinsfile index be9e6bf..6104fe9 100644 --- a/policeSecurityServer/Jenkinsfile +++ b/policeSecurityServer/Jenkinsfile @@ -24,7 +24,7 @@ pipeline { echo '开始推送构建产物' script{ def remote = [:] - remote.name = 'serverRoot' + remote.name = 'server-118.253.177.137' remote.host = '118.253.177.137' remote.port = 55555 remote.allowAnyHosts = true From 06b2337b14eabe8599a8e2c71bd9f4842c168b24 Mon Sep 17 00:00:00 2001 From: luozhun <2025254074@qq.com> Date: Thu, 31 Oct 2024 11:25:20 +0800 Subject: [PATCH 05/15] =?UTF-8?q?superManagement=E6=8E=A5=E5=85=A5Jenkins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- superManagement/Jenkinsfile | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 superManagement/Jenkinsfile diff --git a/superManagement/Jenkinsfile b/superManagement/Jenkinsfile new file mode 100644 index 0000000..701910b --- /dev/null +++ b/superManagement/Jenkinsfile @@ -0,0 +1,46 @@ +pipeline { + agent any + tools { + nodejs "node-v20.10.0" + } + stages { + stage('拉取代码') { + steps { + echo '开始拉取代码' + checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[credentialsId: '3', url: 'http://175.6.124.250:3100/luozhun/policeSecurity.git']]) + echo '代码拉取成功' + } + } + stage('构建前端项目') { + steps{ + echo '开始构建前端项目' + sh 'cd /var/jenkins_home/workspace/警保联动-超级后台/superManagement && npm install --registry=https://registry.npmmirror.com && npm run build' + echo '前端项目构建完成' + } + } + stage('ssh远程推送代码'){ + steps{ + echo '开始推送构建产物' + script{ + def remote = [:] + remote.name = 'server-118.253.177.137' + remote.host = '118.253.177.137' + remote.port = 55555 + remote.allowAnyHosts = true + withCredentials([usernamePassword(credentialsId: '4', passwordVariable: 'password', usernameVariable: 'username')]) { + remote.user = "${username}" + remote.password = "${password}" + } + sshCommand remote: remote, command: 'pwd=$(pwd) echo "ssh连接成功!当前工作目录:$(pwd)"' + sshCommand remote: remote, command: 'echo "删除:superManagement..."' + sshRemove remote: remote, path: '/home/app/apps/1panel/apps/openresty/openresty/www/sites/policeSecurityServer/index/superManagement' + sshCommand remote: remote, command: 'echo "删除:superManagement成功!"' + + sshCommand remote: remote, command: 'echo "将构建的superManagement发送到服务器..."' + sshPut remote: remote, from: '/var/jenkins_home/workspace/警保联动-超级后台/superManagement/superManagement', into: '/home/app/apps/1panel/apps/openresty/openresty/www/sites/policeSecurityServer/index' + sshCommand remote: remote, command: 'echo "superManagement发送成功!"' + } + } + } + } +} From 9247068b72f2a0b92e624043649c2dad1085ce4f Mon Sep 17 00:00:00 2001 From: luozhun <2025254074@qq.com> Date: Thu, 31 Oct 2024 11:27:01 +0800 Subject: [PATCH 06/15] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- superManagement/src/views/unitManage/policeUnit/index.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/superManagement/src/views/unitManage/policeUnit/index.vue b/superManagement/src/views/unitManage/policeUnit/index.vue index aa32290..0a35aa4 100644 --- a/superManagement/src/views/unitManage/policeUnit/index.vue +++ b/superManagement/src/views/unitManage/policeUnit/index.vue @@ -1,4 +1,5 @@