-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1073 from macolso/cron-suh
adding SUH card for cron trigger
- Loading branch information
Showing
1 changed file
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
title = "Spin Cron Trigger" | ||
template = "render_hub_content_body" | ||
date = "2022-10-15T00:22:56Z" | ||
content-type = "text/plain" | ||
tags = ["trigger", "rust", "plugins"] | ||
|
||
[extra] | ||
author = "Fermyon" | ||
type = "hub_document" | ||
category = "Plugin" | ||
language = "Rust" | ||
created_at = "2023-12-05T00:22:56Z" | ||
last_updated = "2023-12-05T00:22:56Z" | ||
spin_version = ">=v2.0.1" | ||
summary = "An experimental cron trigger for Spin apps" | ||
url = "https://github.com/fermyon/spin-trigger-cron" | ||
keywords = "trigger, cron" | ||
|
||
--- | ||
|
||
An experimental plugin that enables cron trigger for Spin applications. | ||
|
||
## Installing Plugin | ||
|
||
You can install the plugin using the following command: | ||
|
||
```bash | ||
spin plugins install --url https://github.com/fermyon/spin-trigger-cron/releases/download/canary/trigger-cron.json | ||
``` | ||
|
||
## Installing Template | ||
|
||
You can install the template using the following command: | ||
|
||
```bash | ||
spin templates install --git https://github.com/fermyon/spin-trigger-cron | ||
``` | ||
|
||
Once the template is installed, you can create a new application using: | ||
|
||
```bash | ||
spin new -t cron-rust hello_cron --accept-defaults | ||
``` | ||
|
||
To run the newly created app: | ||
|
||
```bash | ||
cd hello_cron | ||
spin build --up | ||
``` | ||
|
||
### Configuring the Cron Trigger | ||
|
||
The trigger type is `cron` and there are no application-level configuration options. | ||
|
||
The following options are available to set in the [[trigger.cron]] section: | ||
|
||
| Name | Type | Required? | Description | | ||
|-----------------------|------------------|-----------|-------------| | ||
| `component` | string or table | required | The component to run on the schedule given in `cron_expression`. (This is the standard Spin trigger component field.) | | ||
| `cron_expression` | string | required | The `cron` expression describing the schedule on which to execute the component. | | ||
|
||
```toml | ||
[[trigger.cron]] | ||
component = "<your-component-name>" | ||
cron_expression = "1/2 * * * * *" | ||
``` |