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
2352b148
Commit
2352b148
authored
Jan 04, 2018
by
daidekun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug
parent
a56f5199
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
7 deletions
+69
-7
StageBucket.groovy
src/org/qg/docker/StageBucket.groovy
+20
-6
debugPipeline.groovy
vars/debugPipeline.groovy
+48
-0
qgDockerPipeline.groovy
vars/qgDockerPipeline.groovy
+1
-1
No files found.
src/org/qg/docker/StageBucket.groovy
View file @
2352b148
...
...
@@ -3,6 +3,14 @@ package org.qg.docker;
import
org.qg.docker.Utils
;
import
groovy.json.JsonSlurperClassic
;
def
debug
()
{
echo
project_attr
(
"pinjamancepat-credit-review-ui"
)
configPath
=
res_json
[
"configPath"
]
buildCmd
=
res_json
[
"buildCmd"
]
echo
configPath
echo
buildCmd
}
def
before_prepare
(
contextDir
)
{
sh
"rm -rf ${contextDir}"
sh
"cd /home/quant_group/qg-dockerfiles; git pull; cd -"
...
...
@@ -51,7 +59,7 @@ def checkout(branchName, gitRepo) {
}
}
def
checkout
LuaUI
(
branchName
,
gitRepo
)
{
def
checkout
_lua_ui
(
branchName
,
gitRepo
)
{
if
(
gitRepo
.
contains
(
"--"
)){
t1
=
gitRepo
.
split
(
"/"
)
groups
=
t1
[
0
].
split
(
"--"
)
...
...
@@ -105,11 +113,6 @@ def copy_files_java(systemName, contextDir) {
sh
"cp ${jar_path} ${contextDir}/"
}
@NonCPS
def
jsonParse
(
def
json
)
{
new
groovy
.
json
.
JsonSlurperClassic
().
parseText
(
json
)
}
def
build_nodejs
(
namespace
,
systemName
,
contextDir
)
{
response
=
httpRequest
"http://192.168.4.3:10088/config_server/get_node_command/${systemName}"
...
...
@@ -221,4 +224,15 @@ def deploy(namespace, systemName, imageTag, tier, isDeploy) {
def
clean_images
(
imageTag
)
{
sh
"docker rmi -f \$(docker images -q ${imageTag})"
}
@NonCPS
def
jsonParse
(
def
json
)
{
new
groovy
.
json
.
JsonSlurperClassic
().
parseText
(
json
)
}
def
project_attr
(
systemName
)
{
response
=
httpRequest
"http://192.168.4.3:10088/config_server/get_project_attr/${systemName}"
def
res_json
=
jsonParse
(
response
.
content
)
return
res_json
}
\ No newline at end of file
vars/debugPipeline.groovy
0 → 100644
View file @
2352b148
import
org.qg.docker.*
def
call
(
body
)
{
def
config
=
[:]
def
env
=
body
.
env
def
branchName
=
env
.
BRANCH_NAME
def
gitRepo
=
env
.
GIT_REPO
def
namespace
=
env
.
NAMESPACE
def
isDeploy
=
env
.
IS_DEPLOY
def
buildNumber
=
env
.
BUILD_NUMBER
t
=
gitRepo
.
split
(
"/"
)
def
gitGroup
=
t
[
0
]
def
originSystemName
=
t
[
1
]
def
systemName
=
originSystemName
.
toLowerCase
()
def
harborGroup
=
"library"
def
workspace
=
"/home/quant_group/jenkins_home/workspace/${env.JOB_NAME}"
def
imageTag
def
contextDir
def
_stage
=
new
org
.
qg
.
docker
.
StageBucket
()
def
_utils
=
new
org
.
qg
.
docker
.
Utils
()
body
.
resolveStrategy
=
Closure
.
DELEGATE_FIRST
body
.
delegate
=
config
body
()
node
{
try
{
dir
(
systemName
)
{
timestamps
{
stage
(
'Debug'
)
{
_stage
.
debug
()
}
}
}
}
catch
(
err
)
{
if
(
imageTag
)
{
_stage
.
clean_images
(
imageTag
)
}
currentBuild
.
result
=
'FAILED'
throw
err
}
}
}
\ No newline at end of file
vars/qgDockerPipeline.groovy
View file @
2352b148
...
...
@@ -40,7 +40,7 @@ def call(body) {
_utils
.
beautyEcho
(
2
,
'Checkout'
)
switch
(
config
.
buildType
)
{
case
"lua-ui"
:
_stage
.
checkout
LuaUI
(
branchName
,
gitRepo
)
_stage
.
checkout
_lua_ui
(
branchName
,
gitRepo
)
break
default:
_stage
.
checkout
(
branchName
,
gitRepo
)
...
...
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