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
1bd1bfe1
Commit
1bd1bfe1
authored
Dec 27, 2017
by
daidekun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加openrestry
parent
52b02651
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
1 deletion
+51
-1
StageBucket.groovy
src/org/qg/docker/StageBucket.groovy
+45
-1
qgDockerPipeline.groovy
vars/qgDockerPipeline.groovy
+6
-0
No files found.
src/org/qg/docker/StageBucket.groovy
View file @
1bd1bfe1
...
...
@@ -30,6 +30,18 @@ def prepare_ui(systemName, contextDir) {
sh
"cp -rf /home/quant_group/config_repository/ui/${systemName}.js env.config.js"
}
def
prepare_openresty
(
systemNames
,
contextDir
)
{
sh
"rm -rf ${contextDir}"
sh
"cd /home/quant_group/qg-dockerfiles/templates/openresty; git pull; cd -"
sh
"cp -rf /home/quant_group/qg-dockerfiles/templates/openresty ${contextDir}"
sh
"cd /home/quant_group/config_repository/openresty; git pull; cd -"
arrSystem
=
systemNames
.
spit
(
"--"
)
for
(
systemName
in
arrSystem
)
{
sh
"cp -rf /home/quant_group/config_repository/openresty/${systemName}.js ${systemName}.env.config.js"
}
}
def
prepare_python
(
contextDir
)
{
sh
"rm -rf ${contextDir}"
sh
"cd /home/quant_group/qg-dockerfiles/templates/python; git pull; cd -"
...
...
@@ -67,7 +79,6 @@ def jsonParse(def json) {
new
groovy
.
json
.
JsonSlurperClassic
().
parseText
(
json
)
}
def
build_ui
(
namespace
,
systemName
,
contextDir
,
repoName
,
branchName
,
workspace
)
{
response
=
httpRequest
"http://192.168.4.3:10088/config_server/get_node_command/${systemName}"
...
...
@@ -135,6 +146,39 @@ def build_python(namespace, systemName, contextDir) {
sh
"mv dist.tgz ${contextDir}"
}
def
build_openresty
(
namespace
,
systemNames
,
contextDir
,
repoName
,
branchName
,
workspace
)
{
arrSystem
=
systemNames
.
spit
(
"--"
)
for
(
systemName
in
arrSystem
)
{
response
=
httpRequest
"http://192.168.4.3:10088/config_server/get_node_command/${systemName}"
def
res_json
=
jsonParse
(
response
.
content
)
print
"=====Build Command Is====="
echo
res_json
.
toString
()
configPath
=
res_json
[
"configPath"
]
buildCmd
=
res_json
[
"buildCmd"
]
configName
=
systemName
print
"=========================="
sh
"mv -f env.config.js ${configPath}"
def
bowerFile
=
fileExists
'./bower.json'
print
"=========env info=========="
sh
'''#!/bin/bash
ruby -v
pwd
ls
'''
if
(
bowerFile
)
{
sh
"bower install"
}
sh
buildCmd
sh
'tar zcf ${systemName}.dist.tgz dist/'
sh
"mv ${systemName}.dist.tgz ${contextDir}"
}
}
def
dockerbuild_and_push
(
buildNumber
,
branchName
,
harborGroup
,
systemName
,
contextDir
)
{
regex
=
"[`,./;\\[\\]&<>?:\"()|-]+"
safeBranchName
=
branchName
.
replaceAll
(
regex
,
"_"
)
...
...
vars/qgDockerPipeline.groovy
View file @
1bd1bfe1
...
...
@@ -57,6 +57,9 @@ def call(body) {
case
"python"
:
_stage
.
prepare_python
(
contextDir
)
break
case
"openresty"
:
_stage
.
prepare_openresty
(
contextDir
)
break
default:
echo
"未知的buildType: ${config.buildType}"
break
...
...
@@ -78,6 +81,9 @@ def call(body) {
case
"python"
:
_stage
.
build_python
(
namespace
,
originSystemName
,
contextDir
)
break
case
"openresty"
:
_stage
.
build_openresty
(
namespace
,
originSystemName
,
contextDir
)
break
default:
echo
"未知的buildType: ${config.buildType}"
break
...
...
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