更新发版脚本
This commit is contained in:
parent
43c6a2c92f
commit
1faf678a88
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
.idea
|
||||
ui/**/dist
|
52
Jenkinsfile
vendored
52
Jenkinsfile
vendored
@ -0,0 +1,52 @@
|
||||
pipeline {
|
||||
environment {
|
||||
PROJECT_NAME='ry-das'
|
||||
}
|
||||
agent any
|
||||
tools {
|
||||
dockerTool 'local'
|
||||
}
|
||||
stages {
|
||||
stage('拉取源码') {
|
||||
steps {
|
||||
checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[credentialsId: 'd62224c5-69cf-474a-8845-c2c2bbe1fc00', url: 'https://git.jsspisoft.com/ry-das.git']])
|
||||
}
|
||||
}
|
||||
stage('编译UI') {
|
||||
steps {
|
||||
nodejs(cacheLocationStrategy: workspace(), configId: '8e356590-2fee-4f1f-b0e9-5cea43299887', nodeJSInstallationName: 'nodejs202122') {
|
||||
dir("$WORKSPACE/ui/dasadmin") {
|
||||
sh "npm install"
|
||||
sh "npm run build"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('编译后端') {
|
||||
steps {
|
||||
withMaven(globalMavenSettingsConfig: 'bab2e7fd-587c-4284-9bd8-6b97dfeb2fab', jdk: 'jdk17', maven: 'maven396', mavenSettingsConfig: '') {
|
||||
dir("$WORKSPACE") {
|
||||
sh "mkdir -p das/src/main/resources/static"
|
||||
sh "rm -rf das/src/main/resources/static/*"
|
||||
sh "cp -a ui/dasadmin/dist/* das/src/main/resources/static/"
|
||||
sh "mvn -DskipTests -Pprod -pl das -am clean package"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('发版'){
|
||||
steps {
|
||||
script {
|
||||
def remote = [:]
|
||||
remote.name = "master"
|
||||
remote.host = "192.168.109.195"
|
||||
remote.allowAnyHosts = true
|
||||
remote.user = "root"
|
||||
remote.password = "84805353"
|
||||
sshCommand remote: remote, command: 'cd /uspcloud/usp3/ && docker compose pull services-sypower && docker compose down services-sypower && docker compose up -d services-sypower'
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user