Commit e29782fa authored by tywldx's avatar tywldx
parents 02cf102a bc1279a0
......@@ -45,14 +45,19 @@ def prepare_luaui(systemNames, contextDir) {
}
}
def prepare_python(contextDir) {
def prepare_python(systemName, contextDir) {
sh "rm -rf ${contextDir}"
sh "cp -rf /home/quant_group/qg-dockerfiles/templates/python ${contextDir}"
sh "cp -rf /home/quant_group/config_repository/python/${systemName}.ini ${contextDir}/config.ini"
}
def checkout(branchName, systemName) {
git_path = project_attr(systemName)["gitPath"]
if(git_path =="git@gitabc.xyqb.com:data-riskcontrol/urge-dispatcher.git"){
git_path = "git@gitabc.xyqb.com:data-riskcontrol/urge_dispatcher.git"
}
_utils().beautyEcho("git_path:" + git_path, "info")
git branch: branchName, credentialsId: 'e1ccb1ac-1282-4fb4-b766-530ca1a2a2db', url: git_path
}
......@@ -90,13 +95,17 @@ def checkout_lua_ui(branchName, gitRepo) {
t1.size().times {
dir (projects[it]) {
currentPath = sh (
script: 'pwd',
returnStdout: true
).trim()
project_attr = project_attr(projects[it])
git_path = project_attr["gitPath"]
currentPath = sh (
script: 'pwd',
returnStdout: true
).trim()
def folder = new File( "${currentPath}/.git/hooks" )
if( !folder.exists() ) {
git branch: branches[it], credentialsId: 'e1ccb1ac-1282-4fb4-b766-530ca1a2a2db', url: "git@git.quantgroup.cn:${groups[it]}/${projects[it]}.git"
git branch: branches[it], credentialsId: 'e1ccb1ac-1282-4fb4-b766-530ca1a2a2db', url: git_path
def bowerFile = fileExists './bower.json'
......@@ -107,7 +116,7 @@ def checkout_lua_ui(branchName, gitRepo) {
}else{
sh "\\cp -rf /home/quant_group/config_repository/lua-ui/hook/post-merge .git/hooks/"
sh "chmod +x .git/hooks/post-merge"
git branch: branches[it], credentialsId: 'e1ccb1ac-1282-4fb4-b766-530ca1a2a2db', url: "git@git.quantgroup.cn:${groups[it]}/${projects[it]}.git"
git branch: branches[it], credentialsId: 'e1ccb1ac-1282-4fb4-b766-530ca1a2a2db', url: git_path
}
}
}
......@@ -117,11 +126,14 @@ def checkout_lua_ui(branchName, gitRepo) {
project = t1[1]
dir (project) {
git_path = project_attr(project)["gitPath"]
currentPath = sh (
script: 'pwd',
returnStdout: true
).trim()
project_attr = project_attr(project)
git_path = project_attr["gitPath"]
currentPath = sh (
script: 'pwd',
returnStdout: true
).trim()
def folder = new File( "${currentPath}/.git/hooks" )
if( !folder.exists() ) {
......
......@@ -32,22 +32,7 @@ def call(body) {
stage('Deploy') {
if (action == 'deploy') {
echo 'deploy'
arr_machines = machines.split(",")
count = arr_machines.size()
int_count = (count / 2).toInteger()
machines_list = _utils.partList(arr_machines.toList(), int_count, count)
c = 0
for (machine in machines_list) {
echo "Is deploy to :" + machine
sh "ansible-playbook /etc/ansible/${action}.yml -e project_name=${projectName} -e data_center=${dataCenter} -e machines=${machine[0]} -e tag_name=${tagName} -e force=${force} -e env=${envType} -e tingyun=${tingyun} -v"
c = c + 1
if (c < count) {
env.RELEASE_ACTION = input '是否继续部署?'
}
}
sh "ansible-playbook /etc/ansible/${action}.yml -e project_name=${projectName} -e data_center=${dataCenter} -e machines=${machines} -e tag_name=${tagName} -e force=${force} -e env=${envType} -e tingyun=${tingyun} -v"
}
if (action == 'rollback') {
......
......@@ -72,7 +72,7 @@ def call(body) {
_stage.prepare_nodejs(systemName, contextDir)
break
case "python":
_stage.prepare_python(contextDir)
_stage.prepare_python(systemName, contextDir)
break
case "lua-ui":
_stage.prepare_luaui(systemName, contextDir)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment