Commit 3d6c9bb4 authored by Jin Hai's avatar Jin Hai Committed by GitHub
Browse files

Merge pull request #110 from milvus-ci-robot/0.5.1

Add nightly test for Milvus Jenkins CI

Former-commit-id: 874504a6b1b75adc89928985d3ba18078868bbce
parents 719d9b53 8cfd8a86
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
String cron_string = BRANCH_NAME == "master" || BRANCH_NAME == "0.5.0" || BRANCH_NAME == "0.5.1" ? "H 0 * * *" : ""
String cron_string = BRANCH_NAME == "master" ? "H 0 * * *" : ""
cron_string =  BRANCH_NAME == "0.5.1" ? "H 1 * * *" : cron_string

pipeline {
    agent none

@@ -23,7 +25,6 @@ pipeline {
        SEMVER = "${BRANCH_NAME}"
        JOBNAMES = env.JOB_NAME.split('/')
        PIPELINE_NAME = "${JOBNAMES[0]}"
        NIGHTLIY_TEST = "${cron_string == "" ? false : true}"
    }

    stages {
@@ -123,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"
@@ -158,3 +160,9 @@ pipeline {
    }
}

boolean isTimeTriggeredBuild() {
    if (currentBuild.getBuildCauses('hudson.triggers.TimerTrigger$TimerTriggerCause').size() != 0) {
        return true
    }
    return false
}
+4 −1
Original line number Diff line number Diff line
try {
    def helmResult = sh script: "helm status ${env.PIPELINE_NAME}-${env.BUILD_NUMBER}-single-gpu", returnStatus: true
    if (!helmResult) {
        sh "helm del --purge ${env.PIPELINE_NAME}-${env.BUILD_NUMBER}-single-gpu"
    }
} catch (exc) {
    def helmResult = sh script: "helm status ${env.PIPELINE_NAME}-${env.BUILD_NUMBER}-single-gpu", returnStatus: true
    if (!helmResult) {
+7 −12
Original line number Diff line number Diff line
try {
sh 'helm init --client-only --skip-refresh --stable-repo-url https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts'
sh 'helm repo update'
dir ('milvus-helm') {
@@ -7,8 +6,4 @@ try {
        sh "helm install --wait --timeout 300 --set engine.image.tag=${DOCKER_VERSION} --set expose.type=clusterIP --name ${env.PIPELINE_NAME}-${env.BUILD_NUMBER}-single-gpu -f ci/values.yaml -f ci/filebeat/values.yaml --namespace milvus ."
    }
}
} catch (exc) {
    echo 'Helm running failed!'
    sh "helm del --purge ${env.PIPELINE_NAME}-${env.BUILD_NUMBER}-single-gpu"
    throw exc
}