add isTimeTriggeredBuild function in ci/jenkins/Jenkinsfile

Former-commit-id: d19c73db3fb8a3bc942402b547114b9b554ef585
pull/191/head
milvus-ci-robot 2019-10-26 15:52:35 +08:00
parent 0a7434020f
commit 66cfb2d527
1 changed files with 8 additions and 2 deletions

View File

@ -25,7 +25,6 @@ pipeline {
SEMVER = "${BRANCH_NAME}"
JOBNAMES = env.JOB_NAME.split('/')
PIPELINE_NAME = "${JOBNAMES[0]}"
NIGHTLIY_TEST = "${cron_string == "" ? false : true}"
}
stages {
@ -125,7 +124,8 @@ pipeline {
steps {
container('milvus-test-env') {
script {
if (NIGHTLIY_TEST) {
boolean isNightlyTest = isTimeTriggeredBuild()
if (isNightlyTest) {
load "${env.WORKSPACE}/ci/jenkins/jenkinsfile/singleDevNightlyTest.groovy"
} else {
load "${env.WORKSPACE}/ci/jenkins/jenkinsfile/singleDevTest.groovy"
@ -160,3 +160,9 @@ pipeline {
}
}
boolean isTimeTriggeredBuild() {
for (Object currentBuildCause : script.currentBuild.rawBuild.getCauses()) {
return currentBuildCause.class.getName().contains('TimerTriggerCause')
}
return false
}