Commit 54d14ab1 authored by milvus-ci-robot's avatar milvus-ci-robot
Browse files

add isTimeTriggeredBuild function in ci/jenkins/Jenkinsfile


Former-commit-id: b39c3976e8c21adc910401e283eb27b6118cdae0
parent 5ac19cda
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -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
}