2021-06-10 17:33:49 +08:00
|
|
|
#!/usr/bin/env groovy
|
|
|
|
|
|
|
|
pipeline {
|
|
|
|
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.
|
2021-11-29 10:41:17 +08:00
|
|
|
// idleMinutes 120
|
2021-06-10 17:33:49 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
options {
|
|
|
|
timestamps()
|
2021-06-28 14:14:13 +08:00
|
|
|
timeout(time: 36, unit: 'MINUTES')
|
2021-06-10 17:33:49 +08:00
|
|
|
// parallelsAlwaysFailFast()
|
|
|
|
}
|
|
|
|
|
|
|
|
environment {
|
2021-06-17 15:31:58 +08:00
|
|
|
IMAGE_REPO = "dockerhub-mirror-sh.zilliz.cc/milvusdb"
|
2021-06-22 11:56:03 +08:00
|
|
|
DOCKER_CREDENTIALS_ID = "f0aacc8e-33f2-458a-ba9e-2c44f431b4d2"
|
2021-06-22 14:14:51 +08:00
|
|
|
TARGET_REPO = "milvusdb"
|
2021-10-28 18:44:23 +08:00
|
|
|
HARBOR_CREDENTIAL_ID = "harbor-zilliz-cc-registry"
|
2021-10-28 18:04:41 +08:00
|
|
|
HARBOR_REPO = "harbor.zilliz.cc"
|
2021-06-10 17:33:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
|
|
|
stage ('Publish Milvus Images') {
|
|
|
|
steps {
|
|
|
|
container('main') {
|
|
|
|
script {
|
2021-12-01 13:11:44 +08:00
|
|
|
sh './build/set_docker_mirror.sh'
|
2021-06-10 17:33:49 +08:00
|
|
|
sh "build/builder.sh /bin/bash -c \"make install\""
|
|
|
|
|
|
|
|
def date = sh(returnStdout: true, script: 'date +%Y%m%d').trim()
|
|
|
|
def gitShortCommit = sh(returnStdout: true, script: 'git rev-parse --short HEAD').trim()
|
|
|
|
|
|
|
|
withCredentials([usernamePassword(credentialsId: "${env.DOCKER_CREDENTIALS_ID}", usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) {
|
2021-06-22 14:14:51 +08:00
|
|
|
sh 'docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}'
|
2021-06-10 17:33:49 +08:00
|
|
|
sh """
|
2021-06-22 11:56:03 +08:00
|
|
|
export MILVUS_IMAGE_REPO="${env.TARGET_REPO}/milvus-dev"
|
2021-10-28 18:04:41 +08:00
|
|
|
export MILVUS_HARBOR_IMAGE_REPO="${env.HARBOR_REPO}/milvus/milvus"
|
2021-06-10 17:33:49 +08:00
|
|
|
export MILVUS_IMAGE_TAG="${env.BRANCH_NAME}-${date}-${gitShortCommit}"
|
|
|
|
build/build_image.sh
|
|
|
|
docker push \${MILVUS_IMAGE_REPO}:\${MILVUS_IMAGE_TAG}
|
|
|
|
docker tag \${MILVUS_IMAGE_REPO}:\${MILVUS_IMAGE_TAG} \${MILVUS_IMAGE_REPO}:${env.BRANCH_NAME}-latest
|
2021-10-28 16:54:21 +08:00
|
|
|
docker tag \${MILVUS_IMAGE_REPO}:\${MILVUS_IMAGE_TAG} \${MILVUS_HARBOR_IMAGE_REPO}:\${MILVUS_IMAGE_TAG}
|
2021-06-10 17:33:49 +08:00
|
|
|
docker push \${MILVUS_IMAGE_REPO}:${env.BRANCH_NAME}-latest
|
2021-06-22 11:56:03 +08:00
|
|
|
docker logout
|
2021-06-10 17:33:49 +08:00
|
|
|
"""
|
|
|
|
}
|
2021-10-28 19:53:23 +08:00
|
|
|
|
2021-10-28 18:44:23 +08:00
|
|
|
withCredentials([usernamePassword(credentialsId: "${env.HARBOR_CREDENTIAL_ID}", usernameVariable: 'HARBOR_USERNAME', passwordVariable: 'HARBOR_PASSWORD')]) {
|
|
|
|
sh 'docker login harbor.zilliz.cc -u ${HARBOR_USERNAME} -p ${HARBOR_PASSWORD}'
|
2021-10-28 16:54:21 +08:00
|
|
|
sh """
|
2021-10-28 19:10:27 +08:00
|
|
|
export MILVUS_HARBOR_IMAGE_REPO="${env.HARBOR_REPO}/milvus/milvus"
|
|
|
|
export MILVUS_IMAGE_TAG="${env.BRANCH_NAME}-${date}-${gitShortCommit}"
|
2021-10-28 16:54:21 +08:00
|
|
|
docker push \${MILVUS_HARBOR_IMAGE_REPO}:\${MILVUS_IMAGE_TAG}
|
|
|
|
docker logout
|
|
|
|
"""
|
|
|
|
}
|
2021-10-28 19:53:23 +08:00
|
|
|
}
|
2021-06-10 17:33:49 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-06-18 11:56:05 +08:00
|
|
|
post {
|
2021-08-17 21:16:10 +08:00
|
|
|
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},qa@zilliz.com"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-06-19 13:28:07 +08:00
|
|
|
cleanup {
|
2021-06-18 11:56:05 +08:00
|
|
|
container('main') {
|
|
|
|
script {
|
2021-06-18 18:56:07 +08:00
|
|
|
sh 'find . -name . -o -prune -exec rm -rf -- {} +' /* clean up our workspace */
|
2021-06-18 11:56:05 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-06-10 17:33:49 +08:00
|
|
|
}
|