From a17b11c65e9486a82c5b1f18881d437d74ff049b Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Tue, 20 Oct 2020 15:23:52 +0800 Subject: [PATCH] Determine whether the file has changed --- Jenkinsfile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 4410d81be6..75ae83eeb8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,6 +4,22 @@ pipeline { WK = '/var/lib/jenkins/workspace/TDinternal' WKC= '/var/lib/jenkins/workspace/TDinternal/community' } + stages{ + stage('pre build'){ + agent{label 'master'} + steps{ + sh ''' + ${WKC} + td=`git diff develop remotes/origin/develop` + if [ ! $td ];then + echo "no changes,skip build" + exit 0 + fi + echo "check OK!" + ''' + } + } + } stages { stage('Parallel test stage') { parallel { -- GitLab