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
2bbf8781
Commit
2bbf8781
authored
Nov 14, 2017
by
daidekun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qgDockerPipeline
parent
8af27d83
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
39 deletions
+57
-39
qgDockerPipeline.groovy
vars/qgDockerPipeline.groovy
+57
-0
standardPipeline.groovy
vars/standardPipeline.groovy
+0
-39
No files found.
vars/qgDockerPipeline.groovy
0 → 100644
View file @
2bbf8781
import
org.qg.*
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
systemName
=
t
[
1
]
def
harborGroup
=
"library"
def
workspace
=
"/home/quant_group/jenkins_home/workspace/${env.JOB_NAME}"
def
imageTag
def
contextDir
def
_stage
=
new
org
.
foo
.
Stage
()
def
_utils
=
new
org
.
foo
.
Utils
()
body
.
resolveStrategy
=
Closure
.
DELEGATE_FIRST
body
.
delegate
=
config
body
()
node
{
try
{
stage
(
'Checkout'
)
{
contextDir
=
_utils
.
contextDir
(
workspace
)
_stage
.
checkout
(
branchName
,
contextDir
,
gitRepo
)
}
stage
(
'Build'
)
{
_stage
.
build
(
namespace
,
systemName
,
contextDir
)
}
stage
(
'Docker Build And Push'
)
{
imageTag
=
_stage
.
docker_build_and_push
(
buildNumber
,
branchName
,
contextDir
)
}
stage
(
'Deploy'
)
{
_stage
.
deploy
(
namespace
,
systemName
,
imageTag
,
isDeploy
)
}
stage
(
"Clean"
)
{
_stage
.
clean
(
contextDir
)
}
}
catch
(
err
)
{
currentBuild
.
result
=
'FAILED'
throw
err
}
}
}
\ No newline at end of file
vars/standardPipeline.groovy
deleted
100644 → 0
View file @
8af27d83
import
org.qg.*
def
call
(
body
)
{
def
config
=
[:]
def
branchName
=
body
.
env
.
BRANCH_NAME
body
.
resolveStrategy
=
Closure
.
DELEGATE_FIRST
body
.
delegate
=
config
body
()
node
{
try
{
stage
(
'Clone'
)
{
print
branchName
}
stage
(
'Build'
)
{
sh
"echo 'building ${config.projectName} ...'"
}
stage
(
'Tests'
)
{
parallel
'static'
:
{
sh
"echo 'shell scripts to run static tests...'"
},
'unit'
:
{
sh
"echo 'shell scripts to run unit tests...'"
},
'integration'
:
{
sh
"echo 'shell scripts to run integration tests...'"
}
}
stage
(
'Deploy'
)
{
sh
"echo 'deploying to server ${config.serverDomain}...'"
}
}
catch
(
err
)
{
currentBuild
.
result
=
'FAILED'
throw
err
}
}
}
\ No newline at end of file
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