Question: How to specify multiple days with different start/stop times


#1

We would like to have a concourse step trigger anytime spanning multiple days of week. I imagine that this is a use-case that has been addressed, but I can’t figure out how to do it. I can successfully push a pipeline with the following definition, but I get a ‘checking failed’ error on the Schedule resource:

This should trigger as true every 10 minutes between Friday at 10pm and Saturday at 6am.

resources:
- name: schedule
  type: time
  source:
    days:
    - Friday:
      start: 10:00 PM
      stop: 11:59 PM
    - Saturday:
      start: 12:00 AM
      stop: 06:00 AM
    interval: 10m
    location: America/New_York

#2

Hi @gaigaslab

I think you’re got the wrong idea about the days parameter. It’s just supposed to be a an array of Weekdays, however you’re passing in a map of items.

resources:
- name: schedule
  type: time
  source:
    interval: 10m
    location: America/New_York
    start: 10:00 PM
    start: 06:00 AM
    days:
    - Friday
    - Saturday

OR

resources:
- name: schedule
  type: time
  source:
    interval: 10m
    location: America/New_York
    start: 10:00 PM
    start: 06:00 AM
    days: [ Friday, Saturday ]

I was just reading through the code on how the time check resource works and I think that if you use the above you’ll get the ranges

10:00 PM Friday   until 06:00 AM Saturday

and

10:00 PM Saturday until 11:59 PM Saturday

#3

Thank you. I think that I understand the logic.
I tested this evening and setting as below caused it to succeed only on Monday, not into Tuesday, so there doesn’t seem to be a way to trigger in the evening on one day and into the morning of the next day.

Definition:

resources:
  name: schedule
  type: time
  source:
    days:
    - Monday
    interval: 10m
    location: America/New_York
   start: 11:00 PM
   stop: 6:00 AM

Result:

# schedule

checked 1m 49s ago

    ### checking successfully

    * time 2018-08-14T03:51:02.420166434Z
    * time 2018-08-14T03:41:01.627175671Z
    * time 2018-08-14T03:31:00.868180707Z
    * time 2018-08-14T03:21:00.136372452Z
    * time 2018-08-14T03:10:58.34420642Z
    * time 2018-08-14T03:00:57.079353367Z