Commit aa54c497 authored by 智勇's avatar 智勇

nodejs

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