check format (#123)

Signed-off-by: marsishandsome <marsishandsome@gmail.com>
This commit is contained in:
Liangliang Gu 2021-02-04 11:06:23 +08:00 committed by GitHub
parent 25e0ab3b14
commit f7aa9c6cfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 0 deletions

View File

@ -20,6 +20,22 @@ def call(ghprbActualCommit, ghprbPullId, ghprbPullTitle, ghprbPullLink, ghprbPul
}
}
stage('Format') {
dir("/home/jenkins/agent/git/client-java") {
sh """
mvn com.coveo:fmt-maven-plugin:format
git diff --quiet
formatted="\$?"
if [[ "\${formatted}" -eq 1 ]]
then
echo "code format error, please run the following commands:"
echo " mvn com.coveo:fmt-maven-plugin:format"
exit 1
fi
"""
}
}
stage('Build') {
dir("/home/jenkins/agent/git/client-java") {
timeout(30) {