Determine whether the file has changed

This commit is contained in:
liuyq-617 2020-10-20 15:54:41 +08:00
parent a17b11c65e
commit b3120b1b4b
1 changed files with 40 additions and 17 deletions

57
Jenkinsfile vendored
View File

@ -4,29 +4,35 @@ 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('pre build'){
agent{label 'master'}
steps{
sh '''
cd ${WKC}
td=`git diff develop remotes/origin/develop`
if [ ! $td ];then
echo "no changes,skip build"
exit 0
fi
echo "check OK!"
'''
}
}
stage('Parallel test stage') {
parallel {
stage('pytest') {
agent{label 'master'}
steps {
sh '''
cd ${WKC}
td=`git diff develop remotes/origin/develop`
if [ ! $td ];then
echo "no changes,skip build"
exit 0
fi
date
cd ${WKC}
git checkout develop
@ -52,6 +58,12 @@ pipeline {
agent{label '184'}
steps {
sh '''
cd ${WKC}
td=`git diff develop remotes/origin/develop`
if [ ! $td ];then
echo "no changes,skip build"
exit 0
fi
date
cd ${WKC}
git checkout develop
@ -78,7 +90,12 @@ pipeline {
agent{label "185"}
steps {
sh '''
cd ${WKC}
td=`git diff develop remotes/origin/develop`
if [ ! $td ];then
echo "no changes,skip build"
exit 0
fi
cd ${WKC}
git checkout develop
git pull
@ -107,6 +124,12 @@ pipeline {
agent{label "186"}
steps {
sh '''
cd ${WKC}
td=`git diff develop remotes/origin/develop`
if [ ! $td ];then
echo "no changes,skip build"
exit 0
fi
date
cd ${WKC}
git checkout develop