代码拉取完成,页面将自动刷新
同步操作将从 若依/RuoYi-Cloud 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
pipeline {
agent {
node {
label 'mavenjdk17'
}
}
stages {
stage('拉取代码') {
agent none
steps {
git(credentialsId: 'gitee', url: 'https://gitee.com/mayade5664/busishenwang-java-service.git', branch: 'dev', changelog: true, poll: false)
}
}
stage('单元测试') {
agent none
steps {
container('maven') {
sh 'mvn clean test'
}
}
}
stage('代码分析') {
agent none
steps {
container('maven') {
withCredentials([string(credentialsId : 'sonar-token' ,variable : 'SONAR_TOKEN' ,)]) {
withSonarQubeEnv('sonar') {
sh 'mvn sonar:sonar -Dsonar.login=$SONAR_TOKEN'
}
}
timeout(unit: 'HOURS', activity: true, time: 1) {
waitForQualityGate 'true'
}
}
}
}
stage('构建打包') {
agent none
steps {
container('maven') {
sh 'mvn -Dmaven.test.skip=true clean package'
sh '''
cp ./ruoyi-gateway/target/ruoyi-gateway.jar ./docker/ruoyi/gateway/jar
cp ./ruoyi-auth/target/ruoyi-auth.jar ./docker/ruoyi/auth/jar
cp ./ruoyi-visual/ruoyi-monitor/target/ruoyi-visual-monitor.jar ./docker/ruoyi/visual/monitor/jar
cp ./ruoyi-modules/ruoyi-system/target/ruoyi-modules-system.jar ./docker/ruoyi/modules/system/jar
cp ./ruoyi-modules/ruoyi-file/target/ruoyi-modules-file.jar ./docker/ruoyi/modules/file/jar
cp ./ruoyi-modules/ruoyi-job/target/ruoyi-modules-job.jar ./docker/ruoyi/modules/job/jar
cp ./ruoyi-modules/ruoyi-gen/target/ruoyi-modules-gen.jar ./docker/ruoyi/modules/gen/jar
cp ./ruoyi-modules/busishenwang-novel/target/busishenwang-novel.jar ./docker/ruoyi/modules/novel/jar
cp ./ruoyi-modules/busishenwang-search/target/busishenwang-search.jar ./docker/ruoyi/modules/search/jar'''
}
}
}
stage('构建镜像-推送镜像') {
agent none
steps {
container('maven') {
sh '''docker build -t mayadebi/ruoyi-auth:v$BUILD_NUMBER ./docker/ruoyi/auth
docker build -t mayadebi/ruoyi-auth:latest ./docker/ruoyi/auth
docker build -t mayadebi/ruoyi-gateway:v$BUILD_NUMBER ./docker/ruoyi/gateway
docker build -t mayadebi/ruoyi-gateway:latest ./docker/ruoyi/gateway
docker build -t mayadebi/ruoyi-file:v$BUILD_NUMBER ./docker/ruoyi/modules/file
docker build -t mayadebi/ruoyi-file:latest ./docker/ruoyi/modules/file
docker build -t mayadebi/ruoyi-gen:v$BUILD_NUMBER ./docker/ruoyi/modules/gen
docker build -t mayadebi/ruoyi-gen:latest ./docker/ruoyi/modules/gen
docker build -t mayadebi/ruoyi-job:v$BUILD_NUMBER ./docker/ruoyi/modules/job
docker build -t mayadebi/ruoyi-job:latest ./docker/ruoyi/modules/job
docker build -t mayadebi/busishenwang-novel:v$BUILD_NUMBER ./docker/ruoyi/modules/novel
docker build -t mayadebi/busishenwang-novel:latest ./docker/ruoyi/modules/novel
docker build -t mayadebi/busishenwang-search:v$BUILD_NUMBER ./docker/ruoyi/modules/search
docker build -t mayadebi/busishenwang-search:latest ./docker/ruoyi/modules/search
docker build -t mayadebi/ruoyi-monitor:v$BUILD_NUMBER ./docker/ruoyi/visual/monitor
docker build -t mayadebi/ruoyi-monitor:latest ./docker/ruoyi/visual/monitor'''
withCredentials([usernamePassword(credentialsId : 'dockerhub-id' ,passwordVariable : 'DOCKER_PASSWORD' ,usernameVariable : 'DOCKER_USERNAME' ,)]) {
sh 'docker login -u fzyqetuo5664@gmail.com -p fzy123456'
sh '''docker push mayadebi/busishenwang-search:latest
docker push mayadebi/ruoyi-auth:latest
docker push mayadebi/ruoyi-gateway:latest
docker push mayadebi/ruoyi-file:latest
docker push mayadebi/ruoyi-gen:latest
docker push mayadebi/ruoyi-job:latest
docker push mayadebi/busishenwang-novel:latest
docker push mayadebi/ruoyi-monitor:latest
docker push mayadebi/ruoyi-auth:v$BUILD_NUMBER
docker push mayadebi/ruoyi-gateway:v$BUILD_NUMBER
docker push mayadebi/ruoyi-file:v$BUILD_NUMBER
docker push mayadebi/ruoyi-gen:v$BUILD_NUMBER
docker push mayadebi/ruoyi-job:v$BUILD_NUMBER
docker push mayadebi/busishenwang-novel:v$BUILD_NUMBER
docker push mayadebi/busishenwang-search:v$BUILD_NUMBER
docker push mayadebi/ruoyi-monitor:v$BUILD_NUMBER
'''
}
}
}
}
stage('推送版本到git') {
agent none
steps {
container('maven') {
sh 'git config --global user.email "503991583@qq.com" '
sh 'git config --global user.name "mayadebi" '
sh 'git tag -a v$BUILD_NUMBER -m "v$BUILD_NUMBER" '
sh 'git push http://17689411237:fzy123456@gitee.com/mayade5664/busishenwang-java-service.git --tags --ipv4'
}
}
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。