Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gaigaslab opened this issue Aug 9, 2018 · 3 comments
Open

Comments

@gaigaslab
Copy link

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
@owenfarrell
Copy link
Member

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.

@dauphinpasdroit
Copy link

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 ?

@owenfarrell
Copy link
Member

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants