add trigger cron every 2 hours

This commit is contained in:
Roberto Cirillo 2022-04-14 17:08:51 +02:00
parent a01f74c667
commit f0e67ccdf9
1 changed files with 5 additions and 4 deletions

9
Jenkinsfile vendored
View File

@ -20,7 +20,8 @@ pipeline {
agent {
label 'CD'
triggers {
cron('H */4 * * 1-5')
//once in every two hours slot between 9 AM and 5 PM every weekday (perhaps at 10:38 AM, 12:38 PM, 2:38 PM, 4:38 PM)
cron('H H(9-16)/2 * * 1-5')
}
}
@ -55,9 +56,9 @@ pipeline {
steps {
sh '''
date=`date`
echo "#Build ${PIPELINE_BUILD_NUMBER},," > $ACTION_REPORT
echo "#StartTime ${date},," >> $ACTION_REPORT
echo "Project,Repo,Result" >> $ACTION_REPORT
echo "#Build ${PIPELINE_BUILD_NUMBER},,"
echo "#StartTime ${date},,"
echo "Project,Repo,Result"
'''
}
}