2019-10-16 21:20:21 +08:00
|
|
|
pipeline {
|
|
|
|
agent none
|
|
|
|
|
|
|
|
options {
|
|
|
|
timestamps()
|
|
|
|
}
|
|
|
|
|
|
|
|
parameters{
|
|
|
|
choice choices: ['Release', 'Debug'], description: '', name: 'BUILD_TYPE'
|
|
|
|
string defaultValue: 'cf1434e7-5a4b-4d25-82e8-88d667aef9e5', description: 'GIT CREDENTIALS ID', name: 'GIT_CREDENTIALS_ID', trim: true
|
|
|
|
string defaultValue: '1a527823-d2b7-44fd-834b-9844350baf14', description: 'JFROG CREDENTIALS ID', name: 'JFROG_CREDENTIALS_ID', trim: true
|
|
|
|
string defaultValue: 'ba070c98-c8cc-4f7c-b657-897715f359fc', description: 'DOCKER CREDENTIALS ID', name: 'DOCKER_CREDENTIALS_ID', trim: true
|
|
|
|
string defaultValue: 'http://192.168.1.202/artifactory/milvus', description: 'JFROG ARTFACTORY URL', name: 'JFROG_ARTFACTORY_URL', trim: true
|
|
|
|
}
|
|
|
|
|
|
|
|
environment {
|
|
|
|
PROJECT_NAME = "milvus"
|
|
|
|
LOWER_BUILD_TYPE = params.BUILD_TYPE.toLowerCase()
|
|
|
|
SEMVER = "${BRANCH_NAME}"
|
|
|
|
JOBNAMES = env.JOB_NAME.split('/')
|
2019-10-18 19:58:20 +08:00
|
|
|
PIPELINE_NAME = "${JOBNAMES[0]}"
|
2019-10-16 21:20:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
2019-10-17 15:02:52 +08:00
|
|
|
stage("Ubuntu 18.04") {
|
2019-10-16 21:20:21 +08:00
|
|
|
environment {
|
2019-10-17 15:02:52 +08:00
|
|
|
OS_NAME = "ubuntu18.04"
|
2019-10-16 21:20:21 +08:00
|
|
|
PACKAGE_VERSION = VersionNumber([
|
2019-10-17 15:27:33 +08:00
|
|
|
versionNumberString : '${SEMVER}-${LOWER_BUILD_TYPE}-ubuntu18.04-x86_64-${BUILD_DATE_FORMATTED, "yyyyMMdd"}-${BUILDS_TODAY}'
|
2019-10-16 21:20:21 +08:00
|
|
|
]);
|
|
|
|
DOCKER_VERSION = "${SEMVER}-${OS_NAME}-${LOWER_BUILD_TYPE}"
|
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
|
|
|
stage("Run Build") {
|
|
|
|
agent {
|
|
|
|
kubernetes {
|
|
|
|
label 'build'
|
|
|
|
defaultContainer 'jnlp'
|
2019-10-16 21:25:02 +08:00
|
|
|
yamlFile 'ci/jenkins/pod/milvus-build-env-pod.yaml'
|
2019-10-16 21:20:21 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
|
|
|
stage('Build') {
|
|
|
|
steps {
|
|
|
|
container('milvus-build-env') {
|
|
|
|
script {
|
2019-10-16 21:37:51 +08:00
|
|
|
load "${env.WORKSPACE}/ci/jenkins/jenkinsfile/build.groovy"
|
2019-10-18 17:24:58 +08:00
|
|
|
load "${env.WORKSPACE}/ci/jenkins/jenkinsfile/coverage.groovy"
|
2019-10-16 21:20:21 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Upload Package') {
|
|
|
|
steps {
|
|
|
|
container('milvus-build-env') {
|
|
|
|
script {
|
2019-10-16 21:37:51 +08:00
|
|
|
load "${env.WORKSPACE}/ci/jenkins/jenkinsfile/package.groovy"
|
2019-10-16 21:20:21 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage("Publish docker images") {
|
|
|
|
agent {
|
|
|
|
kubernetes {
|
|
|
|
label 'publish'
|
|
|
|
defaultContainer 'jnlp'
|
2019-10-16 21:25:02 +08:00
|
|
|
yamlFile 'ci/jenkins/pod/docker-pod.yaml'
|
2019-10-16 21:20:21 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
|
|
|
stage('Publish') {
|
|
|
|
steps {
|
|
|
|
container('publish-images'){
|
|
|
|
script {
|
2019-10-16 21:37:51 +08:00
|
|
|
load "${env.WORKSPACE}/ci/jenkins/jenkinsfile/publishImages.groovy"
|
2019-10-16 21:20:21 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage("Deploy to Development") {
|
|
|
|
agent {
|
|
|
|
kubernetes {
|
|
|
|
label 'dev-test'
|
|
|
|
defaultContainer 'jnlp'
|
2019-10-16 21:25:02 +08:00
|
|
|
yamlFile 'ci/jenkins/pod/testEnvironment.yaml'
|
2019-10-16 21:20:21 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
|
|
|
stage("Deploy to Dev") {
|
|
|
|
steps {
|
|
|
|
container('milvus-test-env') {
|
|
|
|
script {
|
2019-10-16 21:37:51 +08:00
|
|
|
load "${env.WORKSPACE}/ci/jenkins/jenkinsfile/deploySingle2Dev.groovy"
|
2019-10-16 21:20:21 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage("Dev Test") {
|
|
|
|
steps {
|
|
|
|
container('milvus-test-env') {
|
|
|
|
script {
|
2019-10-16 21:37:51 +08:00
|
|
|
load "${env.WORKSPACE}/ci/jenkins/jenkinsfile/singleDevTest.groovy"
|
2019-10-16 21:20:21 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage ("Cleanup Dev") {
|
|
|
|
steps {
|
|
|
|
container('milvus-test-env') {
|
|
|
|
script {
|
2019-10-16 21:37:51 +08:00
|
|
|
load "${env.WORKSPACE}/ci/jenkins/jenkinsfile/cleanupSingleDev.groovy"
|
2019-10-16 21:20:21 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
post {
|
|
|
|
unsuccessful {
|
|
|
|
container('milvus-test-env') {
|
|
|
|
script {
|
2019-10-16 21:37:51 +08:00
|
|
|
load "${env.WORKSPACE}/ci/jenkins/jenkinsfile/cleanupSingleDev.groovy"
|
2019-10-16 21:20:21 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|