time-resource
time-resource copied to clipboard
Question: How to specify multiple days with different start/stop times
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
Assuming that you can't shift your timezone location so that it neatly lines up with your needs, you could you blend two different resources to trigger your job.
resources:
- name: friday_night
type: time
source:
days:
- Friday
start: 10:00 PM
stop: 11:59 PM
interval: 10m
- name: saturday_morning
type: time
source:
days:
- Saturday:
start: 12:00 AM
stop: 06:00 AM
interval: 10m
location: America/New_York
jobs:
- name: the_job_we_want_to_trigger
plan:
- in_parallel:
- get: friday_night
trigger: true
- get: saturday_morning
trigger: true
- task: something
config: # ...
You may run in to an issue akin to #24 at first, but once you get in to a steady-state flow, I think this will work.
Hello,
Based on that, is there a way to use this time resource to trigger a job each month on a specific date ? For example, each 15th day of the month ?
@alphaxr6 - it’s been a while since I cracked open this code. But on initial glance, I’m not seeing support for specifying the day of the month (just day of week and interval). So, I think the closest you could get would be to specify a 30-ish day interval.