Commit 1bd1bfe1 authored by daidekun's avatar daidekun

增加openrestry

parent 52b02651
...@@ -30,6 +30,18 @@ def prepare_ui(systemName, contextDir) { ...@@ -30,6 +30,18 @@ def prepare_ui(systemName, contextDir) {
sh "cp -rf /home/quant_group/config_repository/ui/${systemName}.js env.config.js" sh "cp -rf /home/quant_group/config_repository/ui/${systemName}.js env.config.js"
} }
def prepare_openresty(systemNames, contextDir) {
sh "rm -rf ${contextDir}"
sh "cd /home/quant_group/qg-dockerfiles/templates/openresty; git pull; cd -"
sh "cp -rf /home/quant_group/qg-dockerfiles/templates/openresty ${contextDir}"
sh "cd /home/quant_group/config_repository/openresty; git pull; cd -"
arrSystem = systemNames.spit("--")
for (systemName in arrSystem) {
sh "cp -rf /home/quant_group/config_repository/openresty/${systemName}.js ${systemName}.env.config.js"
}
}
def prepare_python(contextDir) { def prepare_python(contextDir) {
sh "rm -rf ${contextDir}" sh "rm -rf ${contextDir}"
sh "cd /home/quant_group/qg-dockerfiles/templates/python; git pull; cd -" sh "cd /home/quant_group/qg-dockerfiles/templates/python; git pull; cd -"
...@@ -67,7 +79,6 @@ def jsonParse(def json) { ...@@ -67,7 +79,6 @@ def jsonParse(def json) {
new groovy.json.JsonSlurperClassic().parseText(json) new groovy.json.JsonSlurperClassic().parseText(json)
} }
def build_ui(namespace, systemName, contextDir, repoName, branchName, workspace) { def build_ui(namespace, systemName, contextDir, repoName, branchName, workspace) {
response = httpRequest "http://192.168.4.3:10088/config_server/get_node_command/${systemName}" response = httpRequest "http://192.168.4.3:10088/config_server/get_node_command/${systemName}"
...@@ -135,6 +146,39 @@ def build_python(namespace, systemName, contextDir) { ...@@ -135,6 +146,39 @@ def build_python(namespace, systemName, contextDir) {
sh "mv dist.tgz ${contextDir}" sh "mv dist.tgz ${contextDir}"
} }
def build_openresty(namespace, systemNames, contextDir, repoName, branchName, workspace) {
arrSystem = systemNames.spit("--")
for (systemName in arrSystem) {
response = httpRequest "http://192.168.4.3:10088/config_server/get_node_command/${systemName}"
def res_json = jsonParse(response.content)
print "=====Build Command Is====="
echo res_json.toString()
configPath = res_json["configPath"]
buildCmd = res_json["buildCmd"]
configName = systemName
print "=========================="
sh "mv -f env.config.js ${configPath}"
def bowerFile = fileExists './bower.json'
print "=========env info=========="
sh '''#!/bin/bash
ruby -v
pwd
ls
'''
if (bowerFile) {
sh "bower install"
}
sh buildCmd
sh 'tar zcf ${systemName}.dist.tgz dist/'
sh "mv ${systemName}.dist.tgz ${contextDir}"
}
}
def dockerbuild_and_push(buildNumber, branchName, harborGroup, systemName, contextDir) { def dockerbuild_and_push(buildNumber, branchName, harborGroup, systemName, contextDir) {
regex = "[`,./;\\[\\]&<>?:\"()|-]+" regex = "[`,./;\\[\\]&<>?:\"()|-]+"
safeBranchName = branchName.replaceAll(regex,"_") safeBranchName = branchName.replaceAll(regex,"_")
......
...@@ -57,6 +57,9 @@ def call(body) { ...@@ -57,6 +57,9 @@ def call(body) {
case "python": case "python":
_stage.prepare_python(contextDir) _stage.prepare_python(contextDir)
break break
case "openresty":
_stage.prepare_openresty(contextDir)
break
default: default:
echo "未知的buildType: ${config.buildType}" echo "未知的buildType: ${config.buildType}"
break break
...@@ -78,6 +81,9 @@ def call(body) { ...@@ -78,6 +81,9 @@ def call(body) {
case "python": case "python":
_stage.build_python(namespace, originSystemName, contextDir) _stage.build_python(namespace, originSystemName, contextDir)
break break
case "openresty":
_stage.build_openresty(namespace, originSystemName, contextDir)
break
default: default:
echo "未知的buildType: ${config.buildType}" echo "未知的buildType: ${config.buildType}"
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