mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-04 12:59:23 +08:00
7f2d7c1da3
Signed-off-by: sunby <bingyi.sun@zilliz.com>
100 lines
4.4 KiB
Groovy
100 lines
4.4 KiB
Groovy
#!/usr/bin/env groovy
|
|
|
|
pipeline {
|
|
agent none
|
|
options {
|
|
timestamps()
|
|
timeout(time: 30, unit: 'MINUTES')
|
|
buildDiscarder logRotator(artifactDaysToKeepStr: '30')
|
|
// parallelsAlwaysFailFast()
|
|
|
|
}
|
|
stages {
|
|
stage ('E2E Test') {
|
|
matrix {
|
|
axes {
|
|
axis {
|
|
name 'MILVUS_SERVER_TYPE'
|
|
values 'standalone', 'distributed'
|
|
}
|
|
}
|
|
agent {
|
|
kubernetes {
|
|
label "milvus-e2e-test-kind"
|
|
defaultContainer 'main'
|
|
yamlFile "build/ci/jenkins/pod/krte.yaml"
|
|
customWorkspace '/home/jenkins/agent/workspace'
|
|
// We allow this pod to remain active for a while, later jobs can
|
|
// reuse cache in previous created nodes.
|
|
idleMinutes 120
|
|
}
|
|
}
|
|
environment {
|
|
PROJECT_NAME = "milvus"
|
|
SEMVER = "${BRANCH_NAME.contains('/') ? BRANCH_NAME.substring(BRANCH_NAME.lastIndexOf('/') + 1) : BRANCH_NAME}"
|
|
IMAGE_REPO = "dockerhub-mirror-sh.zilliz.cc/milvusdb"
|
|
DOCKER_BUILDKIT = 1
|
|
ARTIFACTS = "${env.WORKSPACE}/artifacts"
|
|
MILVUS_HELM_BRANCH = "datacoord"
|
|
}
|
|
stages {
|
|
stage('Test') {
|
|
steps {
|
|
container('main') {
|
|
dir ('tests/scripts') {
|
|
script {
|
|
def clusterEnabled = "false"
|
|
if ("${MILVUS_SERVER_TYPE}" == "distributed") {
|
|
clusterEnabled = "true"
|
|
}
|
|
|
|
sh """
|
|
MILVUS_CLUSTER_ENABLED=${clusterEnabled} \
|
|
./e2e-k8s.sh \
|
|
--node-image registry.zilliz.com/kindest/node:v1.20.2 \
|
|
--test-extra-arg "--tags=smoke"
|
|
"""
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
post {
|
|
unsuccessful {
|
|
container('jnlp') {
|
|
script {
|
|
def authorEmail = sh returnStdout: true, script: 'git --no-pager show -s --format=\'%ae\' HEAD'
|
|
emailext subject: '$DEFAULT_SUBJECT',
|
|
body: '$DEFAULT_CONTENT',
|
|
recipientProviders: [developers(), culprits()],
|
|
replyTo: '$DEFAULT_REPLYTO',
|
|
to: "${authorEmail}"
|
|
}
|
|
}
|
|
}
|
|
always {
|
|
container('main') {
|
|
script {
|
|
dir("${env.ARTIFACTS}") {
|
|
sh "find ./kind -path '*/history/*' -type f | xargs tar -zcvf artifacts-${PROJECT_NAME}-${MILVUS_SERVER_TYPE}-${SEMVER}-${env.BUILD_NUMBER}-e2e-logs.tar.gz --transform='s:^[^/]*/[^/]*/[^/]*/[^/]*/::g' || true"
|
|
archiveArtifacts artifacts: "**.tar.gz", allowEmptyArchive: true
|
|
sh 'docker rm -f \$(docker network inspect -f \'{{ range \$key, \$value := .Containers }}{{ printf "%s " \$key}}{{ end }}\' kind) || true'
|
|
sh 'docker network rm kind 2>&1 > /dev/null || true'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
cleanup {
|
|
container('main') {
|
|
script {
|
|
sh 'find . -name . -o -prune -exec rm -rf -- {} +' /* clean up our workspace */
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|