YAML Schema
resources: - name: <string> type: CronTrigger configuration: interval: <string> # should be a cron expression branches: include: "^dev.+$" <string> exclude: "^dev-test.+$" <string>
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 | A cron expression string that specifies the time(s) or interval to trigger the step. The 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
| Required | ||||||||||||||||||||||||||
branches | For use in multibranch pipelines, though it will also work with single branch pipelines. An object where
When | Optional |
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 branches: include: "^dev.+$" exclude: "^dev-test.+$" pipelines: - name: pipeline_scheduled_triggers steps: - name: step_1 type: Bash configuration: inputResources: - name: cron_trigger execution: onExecute: - printenv