代码拉取完成,页面将自动刷新
同步操作将从 若依/RuoYi-Cloud 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
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)])
}
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。