代码拉取完成,页面将自动刷新
同步操作将从 许雪里/xxl-job 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/** ========================= 标准配置 ============================= **/
import com.trax.devops.publish.*
import hudson.model.*
@Library('trax-cicd-lib') _
//发布的镜像
def imageMap = [:]
def group = 'dockerimg.lenztechretail.com'
def nameSpace = 'tope'
//maven版本,用来构建的脚本,确定 snapshot / release
def mavenVersion = "release"
//版本号
//String tag = "${BRANCH_NAME}.${MAIN_VERSION}.${SMALL_VERSION}.${BUILD_NUMBER}"
String tag = "${BUILD_TAG}"
//环境列表
def deployEnvList = ['prod']
/** ========================= 应用自定义 ============================= **/
//应用前缀
//应用前缀
def appPrefix = "xxl"
//项目名
def projectName = "${appPrefix}-job"
//服务所在目录,会根据该目录结合appName寻找jar包进行docker镜像构建
def serviceDir = "."
//发布的应用
def appNames = ["job-manager"]
//git仓库地址
def gitUrl = "git@gitee.com:ppz_bj/${projectName}.git"
//通知版本号的dataID
def nacosDataId = "${projectName}.yml"
/** ========================= 发布环境(仅包含发布时使用) ============================= **/
//发版目录
def projectDir = "/data/projects/${nameSpace}/${projectName}"
//默认的发布机器
def targetHosts = [
['publicIp': '172.16.0.69', 'internalIp': '172.16.0.69','id':'']
]
//DEV发布机器
def devHosts = [
['publicIp': '39.106.254.155', 'internalIp': '172.17.0.18','id':'']
]
//DEV发布机器
def testHosts = [
['publicIp': '82.157.12.159', 'internalIp': '10.0.20.36','id':'']
]
//发布机器Uat
def uatHosts = [
[:]
]
// 正式服务器ip列表(阿里云)
def alphaHosts = [
['publicIp': '39.105.151.106', 'internalIp': '172.17.138.94' , 'id':''],
['publicIp': '101.200.60.152', 'internalIp': '172.17.94.232' , 'id':''],
['publicIp': '47.94.90.69', 'internalIp': '172.17.94.216' , 'id':'']
]
def gammaHosts = [
[:]
]
// 正式服务器ip列表(腾讯)
def deltaHosts = [
[:]
]
//动作
def action = "deploy"
//发布用户
def user = 'ppz'
pipeline {
agent any
stages {
stage('Git Checkout') {
steps {
script {
echo "Checkout...${BRANCH_NAME}"
checkout scm
}
}
}
stage('Branch Check') {
steps {
script {
checkTag(BRANCH_NAME)
}
}
}
stage('Input Env') {
steps {
timeout(time: 1, unit: 'MINUTES') {
script {
env.DEPLOY_ENV = input message: '选择部署的环境', ok: 'deploy',
parameters: [choice(name: 'DEPLOY_ENV', choices: ['dev','test','uat','alpha', 'gamma' , 'delta' ], description: '选择部署环境')]
println("deploy to ${env.DEPLOY_ENV}")
deployEnvList = ["${env.DEPLOY_ENV}"]
switch ("${env.DEPLOY_ENV}") {
case 'dev':
targetHosts = devHosts
break;
case 'test':
targetHosts = testHosts
break;
case 'uat':
targetHosts = uatHosts
break;
case 'alpha':
targetHosts = alphaHosts
break;
case 'gamma':
targetHosts = gammaHosts
break;
case 'delta':
targetHosts = deltaHosts
break;
default:
println('error env')
}
println('本次发布地址:' + targetHosts)
}
}
}
}
stage('Deploy') {
steps {
script {
echo '发布......'
if (currentBuild.result == null || currentBuild.result == 'SUCCESS') {
deploy(targetHosts, projectDir, user, deployEnvList, appNames, nacosDataId, action)
}
}
}
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。