java.lang.Object
cd.go.contrib.plugins.configrepo.groovy.dsl.Node<Timer>
cd.go.contrib.plugins.configrepo.groovy.dsl.Timer
All Implemented Interfaces:
Configurable, KeyVal.Mixin, UtilsMixin

public class Timer extends Node<Timer>
Represents a timer specification to perform cron-like trigggers of pipelines.
  • Constructor Details

  • Method Details

    • getSpec

      public String getSpec()
      Specify a cron-like schedule to build the pipeline.

      A cron expression is a string comprised of 6 or 7 fields separated by white space. Fields can contain any of the allowed values, along with various combinations of the allowed special characters for that field.

      Examples:
      Cron expression examples
      ExampleDescription
      0 0 0/4 * * ?Run every 4th hour
      0 0 1 * * ?Run at 1:00 AM everyday
      0 43 2 * * satRun at 2:43 AM every saturday
      0 15 10 3 * ?Run at 10:15 AM on the 3rd day of every month

      The fields are as follows:

      seconds minutes hours day_of_month month day_of_week [year(optional)]

      Cron expression fields
      Field Allowed Values Allowed Special Characters
      seconds 0-59 , - * /
      minutes 0-59 , - * /
      hours 0-23 , - * /
      day of month 0-31 , - * ? / L W
      month 1-12{' '}OR{' '}jan-dec , - * /
      day of week 1-7{' '}OR{' '}sun-sat , - * ? / L #
      year 1970-2099 , - * /

      A field may be an asterix (*), which stands for "all possible values".

      A field may be a question mark (?), which stands for "no specific value". This is useful if I want my trigger to fire on a particular day of the month (say, the 10th), but don't care what day of the week that happens to be, I would put 10 in the day-of-month field, and ? in the day-of-week field.

      A field may contain a slash (/) to signify increments. For example, 0/15 in the seconds field means "the seconds 0, 15, 30, and 45".

      Ranges of numbers are allowed. Ranges are two numbers separated with a hyphen. For example, 8-11 for an "hours" entry specifies execution at hours 8, 9, 10 and 11.

      Lists are allowed. A list is a set of numbers (or ranges) separated by commas. Examples: 1,2,5,9, 0-4,8-12

      Step values can be used together with ranges. For example, 10-22/4 can be used in the hours field to specify command execution every at the hours 10, 14, 18, 22.

      See Also:
    • getOnlyOnChanges

      public Boolean getOnlyOnChanges()
      Skips scheduling if the previous run of the pipeline was with the latest material(s). This option is typically useful when automatic pipeline scheduling is turned off.
    • setSpec

      public void setSpec(String spec)
      Specify a cron-like schedule to build the pipeline.

      A cron expression is a string comprised of 6 or 7 fields separated by white space. Fields can contain any of the allowed values, along with various combinations of the allowed special characters for that field.

      Examples:
      Cron expression examples
      ExampleDescription
      0 0 0/4 * * ?Run every 4th hour
      0 0 1 * * ?Run at 1:00 AM everyday
      0 43 2 * * satRun at 2:43 AM every saturday
      0 15 10 3 * ?Run at 10:15 AM on the 3rd day of every month

      The fields are as follows:

      seconds minutes hours day_of_month month day_of_week [year(optional)]

      Cron expression fields
      Field Allowed Values Allowed Special Characters
      seconds 0-59 , - * /
      minutes 0-59 , - * /
      hours 0-23 , - * /
      day of month 0-31 , - * ? / L W
      month 1-12{' '}OR{' '}jan-dec , - * /
      day of week 1-7{' '}OR{' '}sun-sat , - * ? / L #
      year 1970-2099 , - * /

      A field may be an asterix (*), which stands for "all possible values".

      A field may be a question mark (?), which stands for "no specific value". This is useful if I want my trigger to fire on a particular day of the month (say, the 10th), but don't care what day of the week that happens to be, I would put 10 in the day-of-month field, and ? in the day-of-week field.

      A field may contain a slash (/) to signify increments. For example, 0/15 in the seconds field means "the seconds 0, 15, 30, and 45".

      Ranges of numbers are allowed. Ranges are two numbers separated with a hyphen. For example, 8-11 for an "hours" entry specifies execution at hours 8, 9, 10 and 11.

      Lists are allowed. A list is a set of numbers (or ranges) separated by commas. Examples: 1,2,5,9, 0-4,8-12

      Step values can be used together with ranges. For example, 10-22/4 can be used in the hours field to specify command execution every at the hours 10, 14, 18, 22.

      See Also:
    • setOnlyOnChanges

      public void setOnlyOnChanges(Boolean onlyOnChanges)
      Skips scheduling if the previous run of the pipeline was with the latest material(s). This option is typically useful when automatic pipeline scheduling is turned off.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Node<Timer>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Node<Timer>
    • toString

      public String toString()
      Overrides:
      toString in class Object