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
aa54c497
Commit
aa54c497
authored
Jan 22, 2019
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nodejs
parent
25ecbb0f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
30 deletions
+13
-30
StageBucketTke.groovy
src/org/qg/docker_new/StageBucketTke.groovy
+8
-22
qgDockerPiplineWithDockerSlaveTke.groovy
vars/qgDockerPiplineWithDockerSlaveTke.groovy
+5
-8
No files found.
src/org/qg/docker_new/StageBucketTke.groovy
View file @
aa54c497
...
@@ -23,11 +23,6 @@ def imageTag(harborGroup,k8sSystemName,safeBranchName,tagName){
...
@@ -23,11 +23,6 @@ def imageTag(harborGroup,k8sSystemName,safeBranchName,tagName){
imageTag4_4
[
"harborHost"
]=
"http://192.168.4.4"
imageTag4_4
[
"harborHost"
]=
"http://192.168.4.4"
imageTag4_4
[
"imageTag"
]
=
"192.168.4.4/${harborGroup}/${k8sSystemName}:tke${safeBranchName}-${tagName}"
imageTag4_4
[
"imageTag"
]
=
"192.168.4.4/${harborGroup}/${k8sSystemName}:tke${safeBranchName}-${tagName}"
imageTag4_4
[
"imageTagCode"
]
=
"192.168.4.4/${harborGroup}/${k8sSystemName}:tkeCode${safeBranchName}-${tagName}"
imageTag4_4
[
"imageTagCode"
]
=
"192.168.4.4/${harborGroup}/${k8sSystemName}:tkeCode${safeBranchName}-${tagName}"
// if=="test"){
// imageTag4_4["imageTag"] = "192.168.4.4/${harborGroup}/${k8sSystemName}:tke${safeBranchName}-${tagName}"
// }else{
// imageTag4_4["imageTag"] = "192.168.4.4/${harborGroup}/${k8sSystemName}:tkeCode${safeBranchName}-${tagName}"
// }
return
[
imageTag4_4
]
return
[
imageTag4_4
]
}
}
...
@@ -282,14 +277,7 @@ def checkout_python(systemName, branchName) {
...
@@ -282,14 +277,7 @@ def checkout_python(systemName, branchName) {
}
}
def
checkout_nodejs
(
systemName
,
branchName
)
{
def
checkout_nodejs
(
systemName
,
branchName
)
{
sh
"cp -rf /home/quant_group/qg-dockerfiles/tke/ui/npmrc/common-npmrc /root/.npmrc"
def
npmrcPath
=
"/home/quant_group/config_repository/lua-ui/npmrc/${systemName}-npmrc"
def
specialNpmrc
=
new
File
(
npmrcPath
)
if
(
specialNpmrc
.
exists
()){
sh
"cp -rf ${npmrcPath} .npmrc"
}
def
projectAttr
=
project_attr
(
systemName
)
def
projectAttr
=
project_attr
(
systemName
)
def
gitPath
=
projectAttr
[
"gitPath"
]
def
gitPath
=
projectAttr
[
"gitPath"
]
...
@@ -307,10 +295,9 @@ def checkout_nodejs(systemName, branchName) {
...
@@ -307,10 +295,9 @@ def checkout_nodejs(systemName, branchName) {
}
else
{
}
else
{
echo
">>>>>>>>> not first git clone"
echo
">>>>>>>>> not first git clone"
sh
"cp -rf /home/quant_group/config_repository/lua-ui/hook/post-checkout .git/hooks/"
// sh "cp -rf /home/quant_group/config_repository/lua-ui/hook/post-checkout .git/hooks/"
sh
"chmod +x .git/hooks/post-checkout"
// sh "chmod +x .git/hooks/post-checkout"
git
branch:
branchName
,
credentialsId:
'e1ccb1ac-1282-4fb4-b766-530ca1a2a2db'
,
url:
gitPath
git
branch:
branchName
,
credentialsId:
'e1ccb1ac-1282-4fb4-b766-530ca1a2a2db'
,
url:
gitPath
}
}
sh
"npm install"
sh
"npm install"
...
@@ -373,8 +360,8 @@ def checkout_luaui(systemName, branchName) {
...
@@ -373,8 +360,8 @@ def checkout_luaui(systemName, branchName) {
return
return
}
else
{
}
else
{
echo
">>>>>>> is node ui project"
echo
">>>>>>> is node ui project"
sh
"cp -rf /home/quant_group/config_repository/lua-ui/hook/post-checkout .git/hooks/"
//
sh "cp -rf /home/quant_group/config_repository/lua-ui/hook/post-checkout .git/hooks/"
sh
"chmod +x .git/hooks/post-checkout"
//
sh "chmod +x .git/hooks/post-checkout"
git
branch:
branchName
,
credentialsId:
'e1ccb1ac-1282-4fb4-b766-530ca1a2a2db'
,
url:
gitPath
git
branch:
branchName
,
credentialsId:
'e1ccb1ac-1282-4fb4-b766-530ca1a2a2db'
,
url:
gitPath
sh
"npm install"
sh
"npm install"
...
@@ -417,13 +404,12 @@ def prepare_java(systemName, contextDir) {
...
@@ -417,13 +404,12 @@ def prepare_java(systemName, contextDir) {
}
}
def
prepare_nodejs
(
systemName
,
contextDir
)
{
def
prepare_nodejs
(
systemName
,
contextDir
)
{
sh
"cp -rf /home/quant_group/qg-dockerfiles/t
emplates
/nodejs/* ${contextDir}"
sh
"cp -rf /home/quant_group/qg-dockerfiles/t
ke
/nodejs/* ${contextDir}"
sh
"cp -rf /home/quant_group/config_repository/nodejs/${systemName}.js ${systemName}.env.config"
sh
"cp -rf /home/quant_group/config_repository/nodejs/${systemName}.js ${systemName}.env.config"
sh
"cp -rf /home/quant_group/
config_repository/lua-
ui/npmrc/common-npmrc /root/.npmrc"
sh
"cp -rf /home/quant_group/
qg-dockerfiles/tke/
ui/npmrc/common-npmrc /root/.npmrc"
}
}
def
prepare_luaui
(
systemName
,
contextDir
)
{
def
prepare_luaui
(
systemName
,
contextDir
)
{
// sh "cp -rf /home/quant_group/config_repository/lua-ui/config/${systemName}.js ${systemName}.env.config"
sh
"cp -rf /home/quant_group/qg-dockerfiles/tke/ui/npmrc/common-npmrc /root/.npmrc"
sh
"cp -rf /home/quant_group/qg-dockerfiles/tke/ui/npmrc/common-npmrc /root/.npmrc"
}
}
...
...
vars/qgDockerPiplineWithDockerSlaveTke.groovy
View file @
aa54c497
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
make docker image for test
make docker image for test
*/
*/
def
call
(
body
)
{
def
call
(
body
)
{
ansiColor
(
'xterm'
)
{
ansiColor
(
'xterm'
)
{
...
@@ -62,7 +61,7 @@ def call(body) {
...
@@ -62,7 +61,7 @@ def call(body) {
_utils
.
beautyEcho
(
"checkout & build < ${originSystemName} : ${originBranchName} >"
,
"stage"
)
_utils
.
beautyEcho
(
"checkout & build < ${originSystemName} : ${originBranchName} >"
,
"stage"
)
for
(
def
i
=
0
;
i
<
systemNames
.
length
;
i
++){
for
(
def
i
=
0
;
i
<
systemNames
.
length
;
i
++){
dir
(
systemNames
[
i
]){
dir
(
systemNames
[
i
]){
branchHashCode
=
_stage
.
check_and_build
(
config
.
buildType
,
systemNames
[
i
],
branchNames
[
i
],
contextDir
)
branchHashCode
=
_stage
.
check_and_build
(
config
.
buildType
,
systemNames
[
i
],
branchNames
[
i
],
contextDir
)
}
}
}
}
_utils
.
beautyEcho
(
"build over"
,
"info"
)
_utils
.
beautyEcho
(
"build over"
,
"info"
)
...
@@ -79,22 +78,20 @@ def call(body) {
...
@@ -79,22 +78,20 @@ def call(body) {
imageTagInfos
=
_stage
.
imageTag
(
harborGroup
,
k8sSystemName
,
safeBranchName
,
timeStemp
)
imageTagInfos
=
_stage
.
imageTag
(
harborGroup
,
k8sSystemName
,
safeBranchName
,
timeStemp
)
for
(
imageTagInfo
in
imageTagInfos
){
for
(
imageTagInfo
in
imageTagInfos
){
_stage
.
dockerbuild_and_push
(
imageTagInfo
,
buildNumber
,
originSystemName
,
originBranchName
,
cluster
,
timeStemp
,
contextDir
,
branchHashCode
)
_stage
.
dockerbuild_and_push
(
imageTagInfo
,
buildNumber
,
originSystemName
,
originBranchName
,
cluster
,
timeStemp
,
contextDir
,
branchHashCode
)
}
}
_stage
.
deploy
(
namespace
,
originSystemName
,
imageTagInfos
[
0
][
"imageTag"
],
config
.
tier
,
isDeploy
)
_stage
.
deploy
(
namespace
,
originSystemName
,
imageTagInfos
[
0
][
"imageTag"
],
config
.
tier
,
isDeploy
)
}
}
/* 4 */
/* 4 */
stage
(
'Clean'
){
stage
(
'Clean'
){
_utils
.
beautyEcho
(
"Clear Cache Tmp"
,
"stage"
)
_utils
.
beautyEcho
(
"Clear Cache Tmp"
,
"stage"
)
_stage
.
clean_images
(
imageTagInfos
[
0
][
"imageTag"
],
imageTagInfos
[
0
][
"imageTagCode"
],
contextDir
)
_stage
.
clean_images
(
imageTagInfos
[
0
][
"imageTag"
],
imageTagInfos
[
0
][
"imageTagCode"
],
contextDir
)
}
}
}
catch
(
err
)
{
}
catch
(
err
)
{
_utils
.
beautyEcho
(
err
,
"fail"
)
_utils
.
beautyEcho
(
err
,
"fail"
)
if
(
imageTagInfos
!=
null
){
if
(
imageTagInfos
!=
null
){
_stage
.
clean_images
(
imageTagInfos
[
0
][
"imageTag"
],
contextDir
)
_stage
.
clean_images
(
imageTagInfos
[
0
][
"imageTag"
],
imageTagInfos
[
0
][
"imageTagCode"
],
contextDir
)
}
}
throw
err
throw
err
}
}
...
...
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