Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
global-jenkinsfile
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
global-jenkinsfile
Commits
35719ed8
Commit
35719ed8
authored
Dec 05, 2017
by
tong.li
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.quantgroup.cn:QA/global-jenkinsfile
parents
df9aa373
4f51a00c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
StageBucket.groovy
src/org/qg/docker/StageBucket.groovy
+7
-3
qgAnsiblePipeline.groovy
vars/qgAnsiblePipeline.groovy
+5
-6
No files found.
src/org/qg/docker/StageBucket.groovy
View file @
35719ed8
...
@@ -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}"
...
...
vars/qgAnsiblePipeline.groovy
View file @
35719ed8
...
@@ -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"
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment