Compare commits
No commits in common. "44bff02808b8ddb3153de45bdc4d00a28dbd2722" and "c4b2b6b57848cdc09517b1ab86c402d6456668a0" have entirely different histories.
44bff02808
...
c4b2b6b578
|
@ -1,43 +0,0 @@
|
||||||
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发送成功!"'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -5,6 +5,7 @@
|
||||||
:change-on-select="changeOnSelect"
|
:change-on-select="changeOnSelect"
|
||||||
:options="administrativeDivisionTree"
|
:options="administrativeDivisionTree"
|
||||||
:load-data="loadData"
|
:load-data="loadData"
|
||||||
|
style="width: 500px"
|
||||||
:allow-clear="allowClear"
|
:allow-clear="allowClear"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Reference in New Issue