Skip to content

Commit

Permalink
Don't run E2E tests if change was in docs only (#1368)
Browse files Browse the repository at this point in the history
* Update Jenkinsfile

* Update Jenkinsfile

* Update Jenkinsfile
  • Loading branch information
artemnikitin authored Jul 25, 2019
1 parent 613fb82 commit 7787593
Showing 1 changed file with 27 additions and 7 deletions.
34 changes: 27 additions & 7 deletions build/ci/e2e/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,25 @@ pipeline {
checkout scm
}
}
stage("Run E2E tests") {
steps {
sh 'make -C build/ci ci-e2e'
stage("E2E tests") {
when {
expression {
notOnlyDocs()
}
}
stages {
stage('Run E2E tests') {
steps {
sh 'make -C build/ci ci-e2e'
}
}
stage('Cleanup GKE') {
steps {
build job: 'cloud-on-k8s-e2e-cleanup',
parameters: [string(name: 'GKE_CLUSTER', value: "${GKE_CLUSTER_NAME}")],
wait: false
}
}
}
}
}
Expand All @@ -43,12 +59,16 @@ pipeline {
}
}
cleanup {
build job: 'cloud-on-k8s-e2e-cleanup',
parameters: [string(name: 'GKE_CLUSTER', value: "${GKE_CLUSTER_NAME}")],
wait: false

cleanWs()
}
}

}

def notOnlyDocs() {
// grep succeeds if there is at least one line without docs/
return sh (
script: "git diff --name-status HEAD~1 HEAD | grep -v docs/",
returnStatus: true
) == 0
}

0 comments on commit 7787593

Please sign in to comment.