1 Star 0 Fork 15.1K

Dr.MyCat/RuoYi-Cloud

forked from 若依/RuoYi-Cloud 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Jenkinsfile 2.33 KB
一键复制 编辑 原始数据 按行查看 历史
Dr.MyCat 提交于 2023-05-25 09:07 . 更新部署配置
pipeline {
agent any
environment {
my_env = '设置环境变量...'
remoteHost = "192.168.79.102"
}
stages {
stage('清除构建空间') {
steps {
echo "清除构建空间. 当前路径: "
sh "pwd"
cleanWs()
}
}
stage('拉取代码') {
steps {
git credentialsId: 'gitee-jenkins', url: 'https://gitee.com/jazts/RuoYi-Cloud.git'
}
}
stage('打包前后端') {
steps {
echo "打包后端. 当前路径: "
sh "pwd"
withMaven(globalMavenSettingsConfig: 'fbc3ddee-bcc9-435e-8f00-cde5bda812ac', globalMavenSettingsFilePath: '/opt/modules/maven/apache-maven-3.8.4/conf/settings.xml', jdk: 'jdk8', maven: 'maven3.8.4', mavenLocalRepo: '/opt/modules/maven/repo/', mavenSettingsConfig: 'e134986f-2c4c-408e-9953-a6234cf69ec2', mavenSettingsFilePath: '/opt/modules/maven/apache-maven-3.8.4/conf/settings.xml', traceability: false) {
sh "mvn clean install"
}
echo "打包前端. 当前路径: "
sh "pwd"
sh "cd ${WORKSPACE}/ruoyi-ui && npm i && npm i -D html-webpack-plugin && npm run build:prod"
}
}
stage('拷贝前后端及配置到远程主机') {
steps {
echo "拷贝前后端及配置到远程主机,并清空当前打包内容. 当前路径: "
sh "pwd"
sh "cd ${WORKSPACE}/mydocker/ && sh copy.sh"
cleanWs()
}
}
stage('在远程主机执行脚本') {
steps {
echo '在远程主机执行脚本. 停止原始容器、移除原始容器、修改当前镜像版本、推送当前镜像到镜像仓库、构建最新镜像、容器运行'
sshPublisher(publishers: [sshPublisherDesc(configName: 'jenkins@192.168.79.102', sshCredentials: [encryptedPassphrase: '{AQAAABAAAAAQ4D+zatYyGv/fXafk8qCnH1v31H/vgbIUmLWjX3lWWWM=}', key: '', keyPath: '', username: 'jenkins'], transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: 'cd /home/jenkins/mydocker/ && sh deploy.sh', execTimeout: 1200000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '/home/jenkins', remoteDirectorySDF: false, removePrefix: '', sourceFiles: 'mydocker')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
}
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/jazts/RuoYi-Cloud.git
git@gitee.com:jazts/RuoYi-Cloud.git
jazts
RuoYi-Cloud
RuoYi-Cloud
master

搜索帮助