From c4f56ddd366ffefa0427ebef535f837fe04936fd Mon Sep 17 00:00:00 2001 From: quicksilver Date: Fri, 8 Nov 2019 10:46:25 +0800 Subject: [PATCH] Delete unittest binary on jenkins ci packaging stage --- ci/jenkins/Jenkinsfile | 2 +- ci/jenkins/scripts/packaging.sh | 13 +++++++++++++ .../step/{package.groovy => packaging.groovy} | 4 +--- 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100755 ci/jenkins/scripts/packaging.sh rename ci/jenkins/step/{package.groovy => packaging.groovy} (71%) diff --git a/ci/jenkins/Jenkinsfile b/ci/jenkins/Jenkinsfile index 40d9686415..c2920358af 100644 --- a/ci/jenkins/Jenkinsfile +++ b/ci/jenkins/Jenkinsfile @@ -75,7 +75,7 @@ pipeline { steps { container('milvus-build-env') { script { - load "${env.WORKSPACE}/ci/jenkins/step/package.groovy" + load "${env.WORKSPACE}/ci/jenkins/step/packaging.groovy" } } } diff --git a/ci/jenkins/scripts/packaging.sh b/ci/jenkins/scripts/packaging.sh new file mode 100755 index 0000000000..7687cbf33f --- /dev/null +++ b/ci/jenkins/scripts/packaging.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +set -ex + +pip3 install -r requirements.txt +./yaml_processor.py merge -f /opt/milvus/conf/server_config.yaml -m ../yaml/update_server_config.yaml -i && \ +rm /opt/milvus/conf/server_config.yaml.bak + +if [ -d "/opt/milvus/unittest" ]; then + rm -rf "/opt/milvus/unittest" +fi + +tar -zcvf ./${PROJECT_NAME}-${PACKAGE_VERSION}.tar.gz -C /opt/ milvus \ No newline at end of file diff --git a/ci/jenkins/step/package.groovy b/ci/jenkins/step/packaging.groovy similarity index 71% rename from ci/jenkins/step/package.groovy rename to ci/jenkins/step/packaging.groovy index c07dcd9d88..2b8b333213 100644 --- a/ci/jenkins/step/package.groovy +++ b/ci/jenkins/step/packaging.groovy @@ -1,9 +1,7 @@ timeout(time: 5, unit: 'MINUTES') { dir ("ci/jenkins/scripts") { - sh "pip3 install -r requirements.txt" - sh "./yaml_processor.py merge -f /opt/milvus/conf/server_config.yaml -m ../yaml/update_server_config.yaml -i && rm /opt/milvus/conf/server_config.yaml.bak" + sh "./packaging.sh" } - sh "tar -zcvf ./${PROJECT_NAME}-${PACKAGE_VERSION}.tar.gz -C /opt/ milvus" withCredentials([usernamePassword(credentialsId: "${params.JFROG_CREDENTIALS_ID}", usernameVariable: 'JFROG_USERNAME', passwordVariable: 'JFROG_PASSWORD')]) { def uploadStatus = sh(returnStatus: true, script: "curl -u${JFROG_USERNAME}:${JFROG_PASSWORD} -T ./${PROJECT_NAME}-${PACKAGE_VERSION}.tar.gz ${params.JFROG_ARTFACTORY_URL}/milvus/package/${PROJECT_NAME}-${PACKAGE_VERSION}.tar.gz") if (uploadStatus != 0) {