Commit ad9b7170 authored by 智勇's avatar 智勇

ui

parent 3be61dc4
...@@ -39,8 +39,7 @@ def init_dependency() { ...@@ -39,8 +39,7 @@ def init_dependency() {
def init_image_dependency(buildType,originSystemName,contextDir){ def init_image_dependency(buildType,originSystemName,contextDir){
switch (buildType){ switch (buildType){
case "lua-ui": case "lua-ui":
sh "cp -rf /home/quant_group/qg-dockerfiles/templates/lua-ui/* ${contextDir}" sh "cp -rf /home/quant_group/qg-dockerfiles/tke/ui/* ${contextDir}"
sh "cp -rf /home/quant_group/config_repository/lua-ui/lua/*.lua ${contextDir}"
def isVhFileExist = fileExists "/home/quant_group/config_repository/lua-ui/nginx/${originSystemName}.vh.conf" def isVhFileExist = fileExists "/home/quant_group/config_repository/lua-ui/nginx/${originSystemName}.vh.conf"
if (isVhFileExist) { if (isVhFileExist) {
...@@ -48,15 +47,12 @@ def init_image_dependency(buildType,originSystemName,contextDir){ ...@@ -48,15 +47,12 @@ def init_image_dependency(buildType,originSystemName,contextDir){
}else{ }else{
sh "cp -rf /home/quant_group/config_repository/lua-ui/nginx/default.vh.conf ${contextDir}" sh "cp -rf /home/quant_group/config_repository/lua-ui/nginx/default.vh.conf ${contextDir}"
} }
break break
default: default:
break break
} }
} }
def ext_bower_install(){ def ext_bower_install(){
def bowerFile = fileExists './bower.json' def bowerFile = fileExists './bower.json'
if(bowerFile){ if(bowerFile){
...@@ -329,11 +325,11 @@ def checkout_luaui(systemName, branchName) { ...@@ -329,11 +325,11 @@ def checkout_luaui(systemName, branchName) {
echo "- ${currentPath} -" echo "- ${currentPath} -"
sh "whoami" sh "whoami"
echo "----------------------------" echo "----------------------------"
def npmrcPath = "/home/quant_group/config_repository/lua-ui/npmrc/${systemName}-npmrc" // def npmrcPath = "/home/quant_group/config_repository/lua-ui/npmrc/${systemName}-npmrc"
def specialNpmrc = new File( npmrcPath ) // def specialNpmrc = new File( npmrcPath )
if(specialNpmrc.exists()){ // if(specialNpmrc.exists()){
sh "cp -rf ${npmrcPath} .npmrc" // sh "cp -rf ${npmrcPath} .npmrc"
} // }
_utils().beautyEcho("ui project : ${systemName}" , "info") _utils().beautyEcho("ui project : ${systemName}" , "info")
projectAttr = project_attr(systemName) projectAttr = project_attr(systemName)
...@@ -346,8 +342,6 @@ def checkout_luaui(systemName, branchName) { ...@@ -346,8 +342,6 @@ def checkout_luaui(systemName, branchName) {
if(!hookfolder.exists()){ if(!hookfolder.exists()){
echo ">>>>>>> first checkout project ${systemName}" echo ">>>>>>> first checkout project ${systemName}"
git branch: branchName, credentialsId: 'e1ccb1ac-1282-4fb4-b766-530ca1a2a2db', url: gitPath git branch: branchName, credentialsId: 'e1ccb1ac-1282-4fb4-b766-530ca1a2a2db', url: gitPath
def bowerResult = ext_bower_install() def bowerResult = ext_bower_install()
...@@ -360,7 +354,6 @@ def checkout_luaui(systemName, branchName) { ...@@ -360,7 +354,6 @@ def checkout_luaui(systemName, branchName) {
if(!dist){ if(!dist){
sh "mkdir dist" sh "mkdir dist"
} }
return return
} else { } else {
echo ">>>>>>> is node ui project" echo ">>>>>>> is node ui project"
...@@ -369,11 +362,9 @@ def checkout_luaui(systemName, branchName) { ...@@ -369,11 +362,9 @@ def checkout_luaui(systemName, branchName) {
if (bowerFile) { if (bowerFile) {
sh "bower install --allow-root" sh "bower install --allow-root"
} }
} }
}else{ }else{
if(!packejson.exists()){ if(!packejson.exists()){
echo ">>>>>>> is simple ui project" echo ">>>>>>> is simple ui project"
git branch: branchName, credentialsId: 'e1ccb1ac-1282-4fb4-b766-530ca1a2a2db', url: gitPath git branch: branchName, credentialsId: 'e1ccb1ac-1282-4fb4-b766-530ca1a2a2db', url: gitPath
...@@ -439,8 +430,7 @@ def prepare_nodejs(systemName, contextDir) { ...@@ -439,8 +430,7 @@ def prepare_nodejs(systemName, contextDir) {
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/config_repository/lua-ui/config/${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_python(systemName, contextDir) { def prepare_python(systemName, contextDir) {
...@@ -565,7 +555,7 @@ def dockerbuild_and_push(imageTagInfo,buildNumber,systemName,branchName,cluster, ...@@ -565,7 +555,7 @@ def dockerbuild_and_push(imageTagInfo,buildNumber,systemName,branchName,cluster,
args += "--build-arg SAFE_SYSTEM_NAME=${systemName} " args += "--build-arg SAFE_SYSTEM_NAME=${systemName} "
args += "--build-arg BUILD_SCHEMA=${build_schema} " args += "--build-arg BUILD_SCHEMA=${build_schema} "
args += "--build-arg FROM_IMAGE=${imageTagCode} " args += "--build-arg FROM_IMAGE=${imageTagCode} "
def imageCode = docker.build(imageTagCode, "-f ${contextDir}/DockerfileCode ${contextDir}") def imageCode = docker.build(imageTagCode, "-f ${contextDir}/Code.Dockerfile ${contextDir}")
imageCode.push() imageCode.push()
def image = docker.build(imageTag, "${args} ${contextDir}") def image = docker.build(imageTag, "${args} ${contextDir}")
image.push() image.push()
......
...@@ -58,22 +58,15 @@ def call(body) { ...@@ -58,22 +58,15 @@ def call(body) {
/* 2 */ /* 2 */
echo originSystemName echo originSystemName
withDockerServer([uri: "tcp://192.168.4.96:2375/"]) { withDockerServer([uri: "tcp://192.168.4.96:2375/"]) {
_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, imageType) branchHashCode = _stage.check_and_build(config.buildType, systemNames[i], branchNames[i], contextDir, imageType)
} }
} }
_utils.beautyEcho("build over", "info") _utils.beautyEcho("build over", "info")
} }
/* 3 */ /* 3 */
withDockerServer([uri: "tcp://192.168.4.96:2375/"]) { withDockerServer([uri: "tcp://192.168.4.96:2375/"]) {
......
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