Schedule cron job in Jenkins CI

Signed-off-by: quicksilver <zhifeng.zhang@zilliz.com>
pull/4973/head^2
quicksilver 2021-03-22 11:55:17 +08:00 committed by yefu.chen
parent f4d055cf42
commit 321d020b0f
2 changed files with 8 additions and 2 deletions

View File

@ -1,4 +1,5 @@
timeout(time: 150, unit: 'MINUTES') {
def isTimeTriggeredBuild = currentBuild.getBuildCauses('hudson.triggers.TimerTrigger$TimerTriggerCause').size() != 0
container('deploy-env') {
dir ('milvus-helm-chart') {
sh " helm version && \
@ -49,7 +50,12 @@ timeout(time: 150, unit: 'MINUTES') {
try {
dir ('tests/python_test') {
sh "python3 -m pip install --no-cache-dir -r requirements.txt"
sh "pytest --tags=0331 --ip ${env.HELM_RELEASE_NAME}-milvus-ha.${env.HELM_RELEASE_NAMESPACE}.svc.cluster.local"
if (isTimeTriggeredBuild) {
echo "This is Cron Job!"
sh "pytest --tags=0331 --ip ${env.HELM_RELEASE_NAME}-milvus-ha.${env.HELM_RELEASE_NAMESPACE}.svc.cluster.local"
} else {
sh "pytest --tags=0331 --ip ${env.HELM_RELEASE_NAME}-milvus-ha.${env.HELM_RELEASE_NAMESPACE}.svc.cluster.local"
}
}
} catch (exc) {
echo 'PyTest Regression Failed !'

View File

@ -2,7 +2,7 @@
@Library('mpl') _
String cron_timezone = "TZ=Asia/Shanghai"
String cron_string = BRANCH_NAME == "r0.3-test" ? "50 22 * * * " : ""
String cron_string = BRANCH_NAME == "r0.3-test" ? "50 22,4,10,16 * * * " : ""
pipeline {
agent none