Commit 01c41f89 authored by kalvin's avatar kalvin

Merge branch 'master' of git.quantgroup.cn:QA/global-jenkinsfile

parents b0e6ee28 5d90a3bf
......@@ -128,7 +128,7 @@ def checkout_nodejs(systemName, branchName) {
if (bowerFile) {
sh "bower install --allow-root"
}
sh "npm install -g"
sh "npm install"
}
......@@ -220,10 +220,10 @@ def build_luaui( systemName, contextDir) {
configPath = res_json["configPath"]
buildCmd = res_json["buildCmd"]
configName = systemName
sh "mv -f ../${systemName}.env.config.js ${configPath}"
sh "mv -f ./${systemName}.env.config.js ${configPath}"
sh buildCmd
sh "tar zcf ${systemName}.tgz dist/"
sh "mv ${systemName}.tgz ../${contextDir}"
sh "mv ${systemName}.tgz ${contextDir}"
}
......@@ -318,7 +318,7 @@ def getDocketPackageImage(buildType){
args +="-v /root/.cache:/root/.cache "
packageImageInfo["image"] = "192.168.4.36/baseimg/jenkins-node-slave:2018040402"
packageImageInfo["args"] = ""
packageImageInfo["args"] = args
break
case "python":
packageImageInfo["image"] = ""
......@@ -348,7 +348,7 @@ def checkAndBuild(buildType,systemName,branchName,contextDir){
def pacegeDockerInfo = getDocketPackageImage(buildType)
docker.image(pacegeDockerInfo["image"]).inside(pacegeDockerInfo["args"]){
try{
/*checkout code*/
checkout(buildType, systemName, branchName)
......@@ -361,6 +361,30 @@ def checkAndBuild(buildType,systemName,branchName,contextDir){
build(buildType, systemName, contextDir)
} catch(err){
sleep 120
throw err
}
}
}
def dockerMake(buildNumber,systemName,branchName,cluster,harborGroup,k8sSystemName,safeBranchName,timeStemp){
imageTag = imageTag(harborGroup,k8sSystemName,safeBranchName,timeStemp)
withDockerRegistry([credentialsId: 'harbor-qajenkins', url: "http://192.168.4.36"]) {
def build_schema = "BUILD_TIME:${timeStemp}@BUILD_NUMBER:${buildNumber}@SYSTEM_NAME:${systemName}@BRANCH_NAME:${branchName}@CLUSTER:${cluster}"
echo build_schema
def image = docker.build(imageTag, "--build-arg BUILD_SCHEMA=${build_schema} ${contextDir}")
image.push()
if (branchName == "master" || branchName == "master--master") {
image.push('latest')
}
}
}
......@@ -65,20 +65,7 @@ def call(body) {
_utils.beautyEcho("build over", "info")
stage('make docker image') {
_utils.beautyEcho("make docker image", "stage")
imageTag = _stage.imageTag(harborGroup,k8sSystemName,safeBranchName,timeStemp)
withDockerRegistry([credentialsId: 'harbor-qajenkins', url: "http://192.168.4.36"]) {
def build_schema = "BUILD_TIME:${timeStemp}@BUILD_NUMBER:${buildNumber}@SYSTEM_NAME:${systemName}@BRANCH_NAME:${branchName}@CLUSTER:${cluster}"
echo build_schema
def image = docker.build(imageTag, "--build-arg BUILD_SCHEMA=${build_schema} ${contextDir}")
image.push()
if (branchName == "master" || branchName == "master--master") {
image.push('latest')
}
}
_stage.dockerMake(buildNumber,systemName,branchName,cluster,harborGroup,k8sSystemName,safeBranchName,timeStemp)
}
......@@ -97,11 +84,11 @@ def call(body) {
}catch (err) {
_utils.beautyEcho(err, "fail")
/* sh "rm -rf ${contextDir}"*/
sh "rm -rf ${contextDir}"
if (imageTag){
_stage.clean_images(imageTag)
}
sleep 120
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