Commit 83f384fd authored by tywldx's avatar tywldx

Merge branch 'master' of http://git.quantgroup.cn/QA/global-jenkinsfile

# Conflicts:
#	src/org/qg/docker/StageBucket.groovy
parents a7f92102 9a70561f
...@@ -15,7 +15,7 @@ def debug() { ...@@ -15,7 +15,7 @@ def debug() {
def before_prepare(contextDir) { def before_prepare(contextDir) {
sh "rm -rf ${contextDir}" sh "rm -rf ${contextDir}"
sh "cd /home/quant_group/qg-dockerfiles; git pull; cd -" sh "cd /home/quant_group/qg-dockerfiles; git pull; cd -"
sh "cd /home/quant_group/config_repository; git pull origin new-config; cd -" sh "cd /home/quant_group/config_repository; git pull origin master; cd -"
} }
def prepare_java(systemName, contextDir) { def prepare_java(systemName, contextDir) {
...@@ -56,6 +56,27 @@ def checkout(branchName, systemName) { ...@@ -56,6 +56,27 @@ def checkout(branchName, systemName) {
git branch: branchName, credentialsId: 'e1ccb1ac-1282-4fb4-b766-530ca1a2a2db', url: git_path git branch: branchName, credentialsId: 'e1ccb1ac-1282-4fb4-b766-530ca1a2a2db', url: git_path
} }
def checkout_nodejs(branchName, systemName) {
git_path = project_attr(systemName)["gitPath"]
def folder = new File( '.git/hooks/' )
if( !folder.exists() ) {
git branch: branchName, credentialsId: 'e1ccb1ac-1282-4fb4-b766-530ca1a2a2db', url: git_path
def bowerFile = fileExists './bower.json'
if (bowerFile) {
sh "bower install --allow-root"
}
sh "npm install"
}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: branchName, credentialsId: 'e1ccb1ac-1282-4fb4-b766-530ca1a2a2db', url: git_path
}
}
def checkout_lua_ui(branchName, gitRepo) { def checkout_lua_ui(branchName, gitRepo) {
if(gitRepo.contains("--")){ if(gitRepo.contains("--")){
t1 = gitRepo.split("/") t1 = gitRepo.split("/")
...@@ -65,25 +86,56 @@ def checkout_lua_ui(branchName, gitRepo) { ...@@ -65,25 +86,56 @@ def checkout_lua_ui(branchName, gitRepo) {
t1.size().times { t1.size().times {
dir (projects[it]) { dir (projects[it]) {
<<<<<<< HEAD
sh "\\config_repositoryp -rf /home/quant_group/config_repository/lua-ui/hook/post-merge .git/hooks/" sh "\\config_repositoryp -rf /home/quant_group/config_repository/lua-ui/hook/post-merge .git/hooks/"
sh "chmod +x .git/hooks/post-merge" sh "chmod +x .git/hooks/post-merge"
=======
def folder = new File( '.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"
def bowerFile = fileExists './bower.json'
if (bowerFile) {
sh "bower install --allow-root"
}
sh "npm install"
}else{
sh "cp -rf /home/quant_group/config_repository/lua-ui/hook/post-merge .git/hooks/"
sh "chmod +x .git/hooks/post-merge"
>>>>>>> 9a70561f7a998386aa5fce9e043c1a9747007410
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@git.quantgroup.cn:${groups[it]}/${projects[it]}.git"
} }
} }
} }
}
else{ else{
t1 = gitRepo.split("/") t1 = gitRepo.split("/")
project = t1[1] project = t1[1]
dir (project) { dir (project) {
git_path = project_attr(project)["gitPath"]
def folder = new File( '.git/hooks/' )
if( !folder.exists() ) {
git branch: branchName, credentialsId: 'e1ccb1ac-1282-4fb4-b766-530ca1a2a2db', url: git_path
def bowerFile = fileExists './bower.json'
if (bowerFile) {
sh "bower install --allow-root"
}
sh "npm install"
}else{
sh "cp -rf /home/quant_group/config_repository/lua-ui/hook/post-merge .git/hooks/" sh "cp -rf /home/quant_group/config_repository/lua-ui/hook/post-merge .git/hooks/"
sh "chmod +x .git/hooks/post-merge" sh "chmod +x .git/hooks/post-merge"
git_path = project_attr(project)["gitPath"]
git branch: branchName, credentialsId: 'e1ccb1ac-1282-4fb4-b766-530ca1a2a2db', url: git_path git branch: branchName, credentialsId: 'e1ccb1ac-1282-4fb4-b766-530ca1a2a2db', url: git_path
} }
} }
}
} }
def build_java(namespace, systemName, contextDir) { def build_java(namespace, systemName, contextDir) {
...@@ -118,12 +170,6 @@ def build_nodejs(namespace, systemName, contextDir) { ...@@ -118,12 +170,6 @@ def build_nodejs(namespace, systemName, contextDir) {
buildCmd = res_json["buildCmd"] buildCmd = res_json["buildCmd"]
configName = systemName configName = systemName
/* def bowerFile = fileExists './bower.json'
if (bowerFile) {
sh "bower install --allow-root"
}*/
sh "mv -f env.config.js ${configPath}" sh "mv -f env.config.js ${configPath}"
sh 'tar zcf dist.tgz ./*' sh 'tar zcf dist.tgz ./*'
sh "mv dist.tgz ${contextDir}" sh "mv dist.tgz ${contextDir}"
...@@ -148,12 +194,6 @@ def build_luaui(namespace, systemNames, contextDir) { ...@@ -148,12 +194,6 @@ def build_luaui(namespace, systemNames, contextDir) {
sh "mv -f ../${systemName}.env.config.js ${configPath}" sh "mv -f ../${systemName}.env.config.js ${configPath}"
/* def bowerFile = fileExists './bower.json'
if (bowerFile) {
sh "bower install --allow-root"
}*/
sh buildCmd sh buildCmd
sh "tar zcf ${systemName}.tgz dist/" sh "tar zcf ${systemName}.tgz dist/"
......
...@@ -44,6 +44,9 @@ def call(body) { ...@@ -44,6 +44,9 @@ def call(body) {
case "lua-ui": case "lua-ui":
_stage.checkout_lua_ui(branchName, gitRepo) _stage.checkout_lua_ui(branchName, gitRepo)
break break
case "nodejs":
_stage.checkout_nodejs(branchName, systemName)
break
default: default:
_stage.checkout(branchName, systemName) _stage.checkout(branchName, systemName)
break break
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment