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() {
def before_prepare(contextDir) {
sh "rm -rf ${contextDir}"
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) {
......@@ -56,6 +56,27 @@ def checkout(branchName, systemName) {
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) {
if(gitRepo.contains("--")){
t1 = gitRepo.split("/")
......@@ -65,10 +86,28 @@ def checkout_lua_ui(branchName, gitRepo) {
t1.size().times {
dir (projects[it]) {
<<<<<<< HEAD
sh "\\config_repositoryp -rf /home/quant_group/config_repository/lua-ui/hook/post-merge .git/hooks/"
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"
}
}
}
}
......@@ -77,12 +116,25 @@ def checkout_lua_ui(branchName, gitRepo) {
project = t1[1]
dir (project) {
sh "cp -rf /home/quant_group/config_repository/lua-ui/hook/post-merge .git/hooks/"
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
}
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
}
}
}
}
......@@ -117,12 +169,6 @@ def build_nodejs(namespace, systemName, contextDir) {
configPath = res_json["configPath"]
buildCmd = res_json["buildCmd"]
configName = systemName
/* def bowerFile = fileExists './bower.json'
if (bowerFile) {
sh "bower install --allow-root"
}*/
sh "mv -f env.config.js ${configPath}"
sh 'tar zcf dist.tgz ./*'
......@@ -148,12 +194,6 @@ def build_luaui(namespace, systemNames, contextDir) {
sh "mv -f ../${systemName}.env.config.js ${configPath}"
/* def bowerFile = fileExists './bower.json'
if (bowerFile) {
sh "bower install --allow-root"
}*/
sh buildCmd
sh "tar zcf ${systemName}.tgz dist/"
......
......@@ -44,6 +44,9 @@ def call(body) {
case "lua-ui":
_stage.checkout_lua_ui(branchName, gitRepo)
break
case "nodejs":
_stage.checkout_nodejs(branchName, systemName)
break
default:
_stage.checkout(branchName, systemName)
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