Commit fe4c5e17 authored by wentao.suo's avatar wentao.suo

fix lua-ui

parent ef0a5821
...@@ -22,11 +22,32 @@ def imageTag(harborGroup,k8sSystemName,safeBranchName,timeStemp){ ...@@ -22,11 +22,32 @@ def imageTag(harborGroup,k8sSystemName,safeBranchName,timeStemp){
return "192.168.4.36/${harborGroup}/${k8sSystemName}:${safeBranchName}-${timeStemp}" return "192.168.4.36/${harborGroup}/${k8sSystemName}:${safeBranchName}-${timeStemp}"
} }
def before_prepare() { def init_dependency() {
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 master; cd -" sh "cd /home/quant_group/config_repository; git pull origin master; cd -"
} }
def init_image_dependency(buildType,originSystemName,contextDir){
switch (buildType){
case "lua-ui":
sh "cp -rf /home/quant_group/qg-dockerfiles/templates/lua-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/${systemNames}.vh.conf"
if (isVhFileExist) {
sh "cp -rf /home/quant_group/config_repository/lua-ui/nginx/${systemNames}.vh.conf ${contextDir}"
}else{
sh "cp -rf /home/quant_group/config_repository/lua-ui/nginx/default.vh.conf ${contextDir}"
}
break
default:
break
}
}
def prepare_config(buildType,systemName, contextDir) { def prepare_config(buildType,systemName, contextDir) {
_utils().beautyEcho("Prepare Config +++ type:${buildType} systemName:${systemName}", "info") _utils().beautyEcho("Prepare Config +++ type:${buildType} systemName:${systemName}", "info")
switch (buildType) { switch (buildType) {
...@@ -59,19 +80,7 @@ def prepare_nodejs(systemName, contextDir) { ...@@ -59,19 +80,7 @@ def prepare_nodejs(systemName, contextDir) {
} }
def prepare_luaui(systemName, contextDir) { def prepare_luaui(systemName, contextDir) {
sh "cp -rf /home/quant_group/qg-dockerfiles/templates/lua-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/${systemName}.vh.conf"
if (isVhFileExist) {
sh "cp -rf /home/quant_group/config_repository/lua-ui/nginx/${systemName}.vh.conf ${contextDir}"
}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/config/${systemName}.js ${systemName}.env.config.js" sh "cp -rf /home/quant_group/config_repository/lua-ui/config/${systemName}.js ${systemName}.env.config.js"
} }
def prepare_python(systemName, contextDir) { def prepare_python(systemName, contextDir) {
...@@ -380,7 +389,7 @@ def check_and_build(buildType,systemName,branchName,contextDir){ ...@@ -380,7 +389,7 @@ def check_and_build(buildType,systemName,branchName,contextDir){
} }
} }
def dockerbuild_and_push(imageTag,buildNumber,systemName,branchName,cluster,timeStemp){ def dockerbuild_and_push(imageTag,buildNumber,systemName,branchName,cluster,timeStemp,contextDir){
//systemName == originSystemName //systemName == originSystemName
stage('Docker Build And Push') { stage('Docker Build And Push') {
withDockerRegistry([credentialsId: 'harbor-qajenkins', url: "http://192.168.4.36"]) { withDockerRegistry([credentialsId: 'harbor-qajenkins', url: "http://192.168.4.36"]) {
......
...@@ -44,7 +44,8 @@ def call(body) { ...@@ -44,7 +44,8 @@ def call(body) {
stage('Init') { stage('Init') {
_utils.beautyEcho("Init", "stage") _utils.beautyEcho("Init", "stage")
contextDir = _stage.contextMkdir("${originSystemName}-${timeStemp}") contextDir = _stage.contextMkdir("${originSystemName}-${timeStemp}")
_stage.before_prepare() _stage.init_dependency()
_stage.init_image_dependency(config.buildType,originSystemName,contextDir)
} }
...@@ -75,7 +76,7 @@ def call(body) { ...@@ -75,7 +76,7 @@ def call(body) {
imageTag = _stage.imageTag(harborGroup,k8sSystemName,safeBranchName,timeStemp) imageTag = _stage.imageTag(harborGroup,k8sSystemName,safeBranchName,timeStemp)
def _systemName = originSystemName.toLowerCase() def _systemName = originSystemName.toLowerCase()
_stage.dockerbuild_and_push(imageTag,buildNumber,_systemName,originBranchName ,cluster,timeStemp) _stage.dockerbuild_and_push(imageTag,buildNumber,_systemName,originBranchName ,cluster,timeStemp,contextDir)
_utils.beautyEcho("Deploy To K8s Cluster image: ${imageTag} to:${namespace}", "stage") _utils.beautyEcho("Deploy To K8s Cluster image: ${imageTag} to:${namespace}", "stage")
_stage.deploy(namespace, _systemName, imageTag, config.tier, isDeploy) _stage.deploy(namespace, _systemName, imageTag, config.tier, isDeploy)
......
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