Validate a stringParam in jenkins job dsl

657 views
Skip to first unread message

AnupamK

unread,
Mar 14, 2016, 10:19:50 AM3/14/16
to job-dsl-plugin


hi All ,
I am very new to the jenkins job dsl and groovy.  I have jenkins job which accept the date from the user and calls the rake task. The code is something like this 

j.with {
  parameters {
    stringParam('CUTOFF_DATE', '2016-03-01', 'Anything created before this date will be deleted')
    booleanParam('ARE_YOU_SURE', false, 'All will be lost beyond hope!')
  }

Here I wanted to validate CUTOFF_DATE which should be in format YYYY-MM-DD. How can I achieve this ? 

Victor Martinez

unread,
Mar 14, 2016, 11:31:50 AM3/14/16
to job-dsl-plugin
I'm afraid, Jenkins itself doesn't provide any specific validation for that input as far as I know, therefore it cannot be done by JobDSL itself rather than adding an extra build step to double check that parameter. Or maybe developing a argument plugin for that particular requirement.

Maybe someone else got some other ideas.

Cheers
Reply all
Reply to author
Forward
0 new messages