Commit 35719ed8 authored by tong.li's avatar tong.li

Merge branch 'master' of git.quantgroup.cn:QA/global-jenkinsfile

parents df9aa373 4f51a00c
...@@ -52,6 +52,8 @@ def copy_files_java(systemName, contextDir) { ...@@ -52,6 +52,8 @@ def copy_files_java(systemName, contextDir) {
case "baitiao": case "baitiao":
jar_path = "baitiao-api/target/*.jar" jar_path = "baitiao-api/target/*.jar"
break break
case "zero-gateway-zuul":
jar_path = "app-starter/target/*.jar"
default: default:
jar_path = "target/*.jar" jar_path = "target/*.jar"
break break
...@@ -95,11 +97,13 @@ def build_ui(namespace, systemName, contextDir, repoName, branchName, workspace) ...@@ -95,11 +97,13 @@ def build_ui(namespace, systemName, contextDir, repoName, branchName, workspace)
if (systemName == "xyqb-ui") { if (systemName == "xyqb-ui") {
sh "grunt build --force" sh "grunt build --force"
}else{ }else if (systemName == "new-mall-ui"){
sh "npm run build --registry http://172.16.3.15:4873"
}
else{
sh buildCmd sh buildCmd
} }
sh 'tar zcf dist.tgz dist/' sh 'tar zcf dist.tgz dist/'
sh "mv dist.tgz ${contextDir}" sh "mv dist.tgz ${contextDir}"
} }
...@@ -123,7 +127,7 @@ def build_nodejs(namespace, systemName, contextDir, repoName, branchName, worksp ...@@ -123,7 +127,7 @@ def build_nodejs(namespace, systemName, contextDir, repoName, branchName, worksp
/* sh "cp -rf /home/quant_group/jenkins_home/workspace/pre.${systemName}/node_modules/ node_modules" /* sh "cp -rf /home/quant_group/jenkins_home/workspace/pre.${systemName}/node_modules/ node_modules"
*/ */
sh "mv -f env.config.js ${configPath}" sh "mv -f env.config.js ${configPath}"
sh "npm install --registry=https://registry.npm.taobao.org" sh "npm install --registry=https://registry.npm.taobao.org"
sh 'tar zcf dist.tgz ./*' sh 'tar zcf dist.tgz ./*'
sh "mv dist.tgz ${contextDir}" sh "mv dist.tgz ${contextDir}"
......
...@@ -24,8 +24,8 @@ def call(body) { ...@@ -24,8 +24,8 @@ def call(body) {
} }
stage('Build') { stage('Build') {
sh "ansible-playbook /etc/ansible/build.yml -e project_name=${envType}.${projectName} -e name_with_namespace=${nameWithNamespace} -e tag_name=${tagName} -e force=${force} -vv" /* sh "ansible-playbook /etc/ansible/build.yml -e project_name=${envType}.${projectName} -e name_with_namespace=${nameWithNamespace} -e tag_name=${tagName} -e force=${force} -vv"
} */ }
stage('Deploy') { stage('Deploy') {
arr_machines = machines.split(",") arr_machines = machines.split(",")
...@@ -37,10 +37,9 @@ def call(body) { ...@@ -37,10 +37,9 @@ def call(body) {
echo "Is deploy to :" + machine echo "Is deploy to :" + machine
sh "ansible-playbook /etc/ansible/service.yml -e project_name=${envType}.${projectName} -e data_center=${dataCenter} -e machines=${machine[0]} -e force=${force} -vv" sh "ansible-playbook /etc/ansible/service.yml -e project_name=${envType}.${projectName} -e data_center=${dataCenter} -e machines=${machine[0]} -e force=${force} -vv"
env.RELEASE_ACTION = input message: '请选择下一步部署动作', ok: '确认', env.RELEASE_ACTION = input '是否继续部署?'
parameters: [choice(name: 'RELEASE_SCOPE', choices: 'Deploy\nRollback', description: '请谨慎选择你要进行的操作')]
if (env.RELEASE_ACTION == true) {
if (env.RELEASE_ACTION == "Deploy") {
sh "ansible-playbook /etc/ansible/${action}.yml -e project_name=${envType}.${projectName} -e data_center=${dataCenter} -e machines=${machine[0]} -e force=${force} -vv" sh "ansible-playbook /etc/ansible/${action}.yml -e project_name=${envType}.${projectName} -e data_center=${dataCenter} -e machines=${machine[0]} -e force=${force} -vv"
} }
} }
......
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