Cloud customer?
Start for Free >
Upgrade in MyJFrog >
What's New in Cloud >

Search





Overview

CronTrigger is used as an inputResource to a step to trigger execution of the step at a scheduled time or at a recurring interval. The minimum recurring interval for CronTrigger is one minute and it supports the cron syntax and UTC time.

Page Contents


YAML Schema

resources:
  - name: 		<string>
     type: 		CronTrigger
     configuration:
       interval:    <string>  # should be a cron expression

Tags

name 

An alphanumeric string (underscores are permitted) that identifies the resource.

type 

Must be CronTrigger for this resource type.

configuration

Specifies all configuration selections for the resource.

Tag

Description

Required/Optional
interval

cron expression string that specifies the time(s) or interval to trigger the step.

The interval tag uses standard Cron expression and takes the following format:

Format
interval: * * * * *                                 
          │ │ │ │ │_________ day of the week (1-7 or SUN-SAT)
          | | | |__________ month (1 - 12)
          | | |__________ day of the month (1 - 31)
          | |__________ hour (0 - 23)
          |__________ minute (0 - 59)

Examples

CRON ExpressionMeaning

0 12 * * *

12 PM (noon) every day.

25 10 * * *

10:25 AM every day.

15 22 * * *

10:15 PM every day.

* 16 * * *

Every minute starting at 4 PM and ending at 4:59 PM, every day.

0/5 13 * * *

Every 5 minutes starting at 1 PM and ending at 1:55 PM, every day.

0/5 15,18 * * *

Every 5 minutes starting at 3 PM and ending at 3:55 PM, and every 5 minutes starting at 6 PM and ending at 6:55 PM, every day.

0-5 18 * * *

Every minute starting at 6 PM and ending at 6:05 PM, every day.

10,44 15 * 5 MON

3:10 PM and at 3:44 PM every Monday in the month of May.

45 10 * * MON-FRI      

10:45 AM every Monday, Tuesday, Wednesday, Thursday and Friday.

30 10 10 * *

10:30 AM on the 10th day of every month.

0 12 1/5 * *

12 PM (noon) on every 5th day-of-month from 1 through 31.

11 11 11 11 *

Every November 11th at 11:11 AM.

  • For more information, see Cron expression.
  • It is recommended that you first test your Cron expression using an online tool before using it.
Required

Environment Variables

Whenever CronTrigger is used in a step, a set of environment variables is automatically made available that you can use in your step.

Environment Variable

Description

res_<resource_name>_name
Name of the resource
res_<resource_name>_interval
The cron string that specifies the time(s) or interval

Examples

The Pipelines DSL for this example is available in this repository in the JFrog GitHub account.

resources:
  - name: cron_trigger
    type: CronTrigger
    configuration:
      interval: '*/5 * * * *'     # Every 5 minutes

pipelines:      
  - name: pipeline_scheduled_triggers
    steps:
      - name: step_1
        type: Bash
        configuration:
          inputResources:
            - name: cron_trigger
        execution:
          onExecute:
            - printenv


  • No labels
Copyright © 2021 JFrog Ltd.