Skip to content

Commit 94d2d38

Browse files
committed
corrected the expression
1 parent 6d5756f commit 94d2d38

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

_docs/kb/articles/create-cron-via-cli-api.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,20 @@ First, you need to create a trigger event ([CLI docs](https://codefresh-
2727
io.github.io/cli/triggers/create-trigger-event/)):
2828

2929
```shell
30-
codefresh create trigger-event --type cron --kind codefresh --value expression="0 0/5 0 ? * --value message=5min
30+
codefresh create trigger-event --type cron --kind codefresh --value expression="0 0/5 * 1/1 * *" --value message=5min
3131
```
3232

3333
The output will be something like this:
3434

3535
```shell
36-
Trigger event: cron:codefresh:0 0/5 0 ? * *:5min:53be218399** was successfully created.
36+
Trigger event: cron:codefresh:0 0/5 * 1/1 * *:5min:53be218399** was successfully created.
3737
```
3838

3939
Then you need to attach the trigger-event to a pipeline ([CLI
4040
doc](https://codefresh-io.github.io/cli/triggers/create-pipeline-trigger/)):
4141

4242
```shell
43-
codefresh create t 'cron:codefresh:0 0/5 0 ? * *:test:53be218399**' <pipeline_ID>
43+
codefresh create t 'cron:codefresh:0 0/5 * 1/1 * *:5min:53be218399**' <pipeline_ID>
4444
```
4545

4646
### API
@@ -52,14 +52,14 @@ The process is the same as with the CLI. First, we create a trigger event
5252
curl -X POST \
5353
-H "Authorization: ${API_KEY}" \
5454
-H 'Content-Type: application/json; charset=utf-8' \
55-
-d "{\"type\":\"cron\",\"kind\":\"codefresh\",\"values\":{\"expression\":\"0 0/5 0 ? * *\",\"message\":\"5min\"}}" \
55+
-d "{\"type\":\"cron\",\"kind\":\"codefresh\",\"values\":{\"expression\":\"0 0/5 * 1/1 * *\",\"message\":\"5min\"}}" \
5656
"https://g.codefresh.io/api/hermes/events?public=$false"
5757
```
5858

5959
Output:
6060

6161
```shell
62-
"cron:codefresh:0 0/5 0 ? * *:5min:53be218399**"
62+
"cron:codefresh:0 0/5 * 1/1 * *:5min:53be218399**"
6363
```
6464

6565
And then attach this event to a pipeline using the output event URI (URL-incoded) from the previous call ([APIdocs](https://g.codefresh.io/api/#operation/triggers-create)):

0 commit comments

Comments
 (0)