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
e29782fa
Commit
e29782fa
authored
Feb 07, 2018
by
tywldx
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.quantgroup.cn/QA/global-jenkinsfile
parents
02cf102a
bc1279a0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
29 deletions
+26
-29
StageBucket.groovy
src/org/qg/docker/StageBucket.groovy
+24
-12
qgAnsiblePipeline.groovy
vars/qgAnsiblePipeline.groovy
+1
-16
qgDockerPipeline.groovy
vars/qgDockerPipeline.groovy
+1
-1
No files found.
src/org/qg/docker/StageBucket.groovy
View file @
e29782fa
...
...
@@ -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
()
)
{
...
...
vars/qgAnsiblePipeline.groovy
View file @
e29782fa
...
...
@@ -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'
)
{
...
...
vars/qgDockerPipeline.groovy
View file @
e29782fa
...
...
@@ -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
)
...
...
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