Commit aa54c497 authored by 智勇's avatar 智勇

nodejs

parent 25ecbb0f
...@@ -23,11 +23,6 @@ def imageTag(harborGroup,k8sSystemName,safeBranchName,tagName){ ...@@ -23,11 +23,6 @@ def imageTag(harborGroup,k8sSystemName,safeBranchName,tagName){
imageTag4_4["harborHost"]="http://192.168.4.4" imageTag4_4["harborHost"]="http://192.168.4.4"
imageTag4_4["imageTag"] = "192.168.4.4/${harborGroup}/${k8sSystemName}:tke${safeBranchName}-${tagName}" imageTag4_4["imageTag"] = "192.168.4.4/${harborGroup}/${k8sSystemName}:tke${safeBranchName}-${tagName}"
imageTag4_4["imageTagCode"] = "192.168.4.4/${harborGroup}/${k8sSystemName}:tkeCode${safeBranchName}-${tagName}" imageTag4_4["imageTagCode"] = "192.168.4.4/${harborGroup}/${k8sSystemName}:tkeCode${safeBranchName}-${tagName}"
// if=="test"){
// imageTag4_4["imageTag"] = "192.168.4.4/${harborGroup}/${k8sSystemName}:tke${safeBranchName}-${tagName}"
// }else{
// imageTag4_4["imageTag"] = "192.168.4.4/${harborGroup}/${k8sSystemName}:tkeCode${safeBranchName}-${tagName}"
// }
return [ imageTag4_4 ] return [ imageTag4_4 ]
} }
...@@ -282,14 +277,7 @@ def checkout_python(systemName, branchName) { ...@@ -282,14 +277,7 @@ def checkout_python(systemName, branchName) {
} }
def checkout_nodejs(systemName, branchName) { def checkout_nodejs(systemName, branchName) {
sh "cp -rf /home/quant_group/qg-dockerfiles/tke/ui/npmrc/common-npmrc /root/.npmrc"
def npmrcPath = "/home/quant_group/config_repository/lua-ui/npmrc/${systemName}-npmrc"
def specialNpmrc = new File( npmrcPath )
if(specialNpmrc.exists()){
sh "cp -rf ${npmrcPath} .npmrc"
}
def projectAttr = project_attr(systemName) def projectAttr = project_attr(systemName)
def gitPath =projectAttr["gitPath"] def gitPath =projectAttr["gitPath"]
...@@ -307,10 +295,9 @@ def checkout_nodejs(systemName, branchName) { ...@@ -307,10 +295,9 @@ def checkout_nodejs(systemName, branchName) {
} else { } else {
echo ">>>>>>>>> not first git clone" echo ">>>>>>>>> not first git clone"
sh "cp -rf /home/quant_group/config_repository/lua-ui/hook/post-checkout .git/hooks/" // sh "cp -rf /home/quant_group/config_repository/lua-ui/hook/post-checkout .git/hooks/"
sh "chmod +x .git/hooks/post-checkout" // sh "chmod +x .git/hooks/post-checkout"
git branch: branchName, credentialsId: 'e1ccb1ac-1282-4fb4-b766-530ca1a2a2db', url: gitPath git branch: branchName, credentialsId: 'e1ccb1ac-1282-4fb4-b766-530ca1a2a2db', url: gitPath
} }
sh "npm install" sh "npm install"
...@@ -373,8 +360,8 @@ def checkout_luaui(systemName, branchName) { ...@@ -373,8 +360,8 @@ def checkout_luaui(systemName, branchName) {
return return
} else{ } else{
echo ">>>>>>> is node ui project" echo ">>>>>>> is node ui project"
sh "cp -rf /home/quant_group/config_repository/lua-ui/hook/post-checkout .git/hooks/" // sh "cp -rf /home/quant_group/config_repository/lua-ui/hook/post-checkout .git/hooks/"
sh "chmod +x .git/hooks/post-checkout" // sh "chmod +x .git/hooks/post-checkout"
git branch: branchName, credentialsId: 'e1ccb1ac-1282-4fb4-b766-530ca1a2a2db', url: gitPath git branch: branchName, credentialsId: 'e1ccb1ac-1282-4fb4-b766-530ca1a2a2db', url: gitPath
sh "npm install" sh "npm install"
...@@ -417,13 +404,12 @@ def prepare_java(systemName, contextDir) { ...@@ -417,13 +404,12 @@ def prepare_java(systemName, contextDir) {
} }
def prepare_nodejs(systemName, contextDir) { def prepare_nodejs(systemName, contextDir) {
sh "cp -rf /home/quant_group/qg-dockerfiles/templates/nodejs/* ${contextDir}" sh "cp -rf /home/quant_group/qg-dockerfiles/tke/nodejs/* ${contextDir}"
sh "cp -rf /home/quant_group/config_repository/nodejs/${systemName}.js ${systemName}.env.config" sh "cp -rf /home/quant_group/config_repository/nodejs/${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_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/qg-dockerfiles/tke/ui/npmrc/common-npmrc /root/.npmrc" sh "cp -rf /home/quant_group/qg-dockerfiles/tke/ui/npmrc/common-npmrc /root/.npmrc"
} }
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
make docker image for test make docker image for test
*/ */
def call(body) { def call(body) {
ansiColor('xterm') { ansiColor('xterm') {
...@@ -62,7 +61,7 @@ def call(body) { ...@@ -62,7 +61,7 @@ def call(body) {
_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) branchHashCode = _stage.check_and_build(config.buildType, systemNames[i], branchNames[i], contextDir)
} }
} }
_utils.beautyEcho("build over", "info") _utils.beautyEcho("build over", "info")
...@@ -79,22 +78,20 @@ def call(body) { ...@@ -79,22 +78,20 @@ def call(body) {
imageTagInfos = _stage.imageTag(harborGroup,k8sSystemName,safeBranchName,timeStemp) imageTagInfos = _stage.imageTag(harborGroup,k8sSystemName,safeBranchName,timeStemp)
for (imageTagInfo in imageTagInfos){ for (imageTagInfo in imageTagInfos){
_stage.dockerbuild_and_push(imageTagInfo,buildNumber,originSystemName,originBranchName ,cluster,timeStemp,contextDir,branchHashCode) _stage.dockerbuild_and_push(imageTagInfo,buildNumber,originSystemName,originBranchName ,cluster,timeStemp,contextDir,branchHashCode)
} }
_stage.deploy(namespace, originSystemName, imageTagInfos[0]["imageTag"], config.tier, isDeploy) _stage.deploy(namespace, originSystemName, imageTagInfos[0]["imageTag"], config.tier, isDeploy)
} }
/* 4 */ /* 4 */
stage('Clean'){ stage('Clean'){
_utils.beautyEcho("Clear Cache Tmp", "stage") _utils.beautyEcho("Clear Cache Tmp", "stage")
_stage.clean_images(imageTagInfos[0]["imageTag"],imageTagInfos[0]["imageTagCode"],contextDir) _stage.clean_images(imageTagInfos[0]["imageTag"],imageTagInfos[0]["imageTagCode"],contextDir)
} }
} catch (err) { } catch (err) {
_utils.beautyEcho(err, "fail") _utils.beautyEcho(err, "fail")
if(imageTagInfos != null){ if(imageTagInfos != null){
_stage.clean_images(imageTagInfos[0]["imageTag"],contextDir) _stage.clean_images(imageTagInfos[0]["imageTag"],imageTagInfos[0]["imageTagCode"],contextDir)
} }
throw err throw err
} }
......
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