Commit 85bd463c authored by 周健君's avatar 周健君

Update Jenkinsfile

parent 5e96ffe7
......@@ -32,8 +32,20 @@ pipeline {
dingNotify "before"
}
}
stage('Check Code') {
//when { branch 'test' }
steps {
script {
currentBuild.displayName = "Check-Code"
checkCode "3.6"
}
}
}
stage('Build') {
steps {
script {
currentBuild.displayName = "Build-Image"
}
sh "docker build . ${params.cache} -f ./Dockerfile -t $IMAGE"
sh "docker push $IMAGE"
}
......@@ -43,7 +55,16 @@ pipeline {
post {
always {
dingNotify "after", "${currentBuild.currentResult}"
script {
def stage = "${currentBuild.displayName}"
if (stage == "Check-Code" && fileExists("./flake.output.txt")) {
def description = readFile("./flake.output.txt")
dingNotify "after", "${currentBuild.currentResult}", "${description}"
} else {
dingNotify "after", "${currentBuild.currentResult}"
}
}
recordIssues enabledForFailure: true, tools: [flake8()]
}
}
}
\ No newline at end of file
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