Reputation: 225
I am trying to run a Jenkins DSL script to create jobs that build periodically with multiple parameters. So far, all I have found is parameterizedCron, but I believe that is for Jenkins Pipeline. Is there something similar for Jenkins DSL?
triggers {
parameterizedCron('''
H 0 * * * % Browser=Chrome;Environment=Dev;TestCase=Student_Login
H 0 * * * % Browser=Firefox;Environment=Dev;TestCase=Student_Login
H 0 * * * % Browser=Safari;Environment=Dev;TestCase=Student_Login
H 0 * * * % Browser=Chrome;Environment=Test;TestCase=Student_Login
H 0 * * * % Browser=Firefox;Environment=Test;TestCase=Student_Login
H 0 * * * % Browser=Safari;Environment=Test;TestCase=Student_Login
''')
}
Upvotes: 3
Views: 1963
Reputation: 225
I have found this answer.
This specifically works for the Jenkins Job DSL:
triggers {
parameterizedTimerTrigger {
parameterizedSpecification('''
H 0 * * * % Browser=Chrome;Environment=Dev;TestCase=${testCaseName}
H 0 * * * % Browser=Firefox;Environment=Dev;TestCase=${testCaseName}
H 0 * * * % Browser=Safari;Environment=Dev;TestCase=${testCaseName}
H 0 * * * % Browser=Chrome;Environment=Test;TestCase=${testCaseName}
H 0 * * * % Browser=Firefox;Environment=Test;TestCase=${testCaseName}
H 0 * * * % Browser=Safari;Environment=Test;TestCase=${testCaseName}
''')
}
}
Upvotes: 2