Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc4a8935

Browse files
committed
Update cron trigger with new git simulation feature
Updated help article with first draft of new content and screenshots
1 parent9fe2d38 commitc4a8935

File tree

5 files changed

+104
-35
lines changed

5 files changed

+104
-35
lines changed
Lines changed: 104 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title:"Cron (Timer) triggers"
3-
description:"Run pipelineswith a time schedule"
2+
title:"Cron (timer) triggers"
3+
description:"Run pipelineson a time schedule"
44
group:pipelines
55
sub_group:triggers
66
redirect_from:
@@ -10,75 +10,143 @@ redirect_from:
1010
toc:true
1111
---
1212

13-
Cron triggers allow you tocreatepipelinesthat starton a specific time schedule. This is very useful for cleanup jobs or periodic checks or any other workflow that needs to run after a time interval.
13+
Cron triggers allow you torun Codefreshpipelines on a specific time schedule, optionally simulating a Git trigger event on a specific repo and branch.
1414

15-
>All times mentioned inCron triggersusetheUTC timezone.
15+
Cron triggers are useful for cleanup jobs, periodic checks, or any other workflow that needs to run repetitively at fixed intervals. By replicating or simulating the behavior of a Git trigger,Cron triggerscan initiate pipeline executions atthepredefined timeintervals and at the same auto-populate the Codefresh environment variables for Git with values from the repo and branch.
1616

17-
##Manage Cron Triggers with Codefresh UI
1817

19-
It is possible to define and manage Cron-based pipeline triggers with Codefresh UI.
2018

21-
###Create a new Cron Trigger
2219

23-
To add a new Cron trigger, navigate to Codefresh Pipeline*Configuration* view and expand*Triggers* section. Press the`Add Trigger` button and select a`Cron` trigger type to add.
20+
You can create and manage Cron triggers for pipelines through the Codefresh UI or CLI.
21+
22+
>**NOTE**:
23+
Cron triggers are created in the UTC timezone.
24+
25+
26+
##Legacy Cron triggers in Codefresh
27+
If you see Cron triggers for your pipeline tagged with {::nomarkdown}<img src="../../../../images/icons/icon-warning.png" display=inline-block">{:/} tag, it indicates that you are using the legacy version.
2428

2529
{% include image.html
2630
lightbox="true"
27-
file="/images/pipeline/triggers/add-trigger-dialog.png"
28-
url="/images/pipeline/triggers/add-trigger-dialog.png"
29-
alt="Adding new Trigger dialog"
31+
file="/images/pipeline/triggers/cron/legacy-cron-trigger-tag.png"
32+
url="/images/pipeline/triggers/cron/legacy-cron-trigger-tag.png"
33+
caption="Legacy Cron trigger in Codefresh UI"
34+
alt="Legacy Cron trigger in Codefresh UI"
3035
max-width="60%"
3136
%}
3237

3338

34-
Visit[this page](https://github.com/codefresh-io/cronus/blob/master/docs/expression.md){:target="\_blank"} to learn about supported`cron` expression format and aliases.
39+
Legacy Cron triggers in the UI are marked as ???. You can edit the trigger and update it
40+
41+
##Cron triggers in Codefresh UI
42+
43+
Create and manage Cron triggers for pipelines in the Codefresh UI.
44+
There are two parts to creating a Cron trigger:
45+
1. Defining the schedule for the trigger
46+
To learn about supported`cron` expression formats and aliases, visit[this page](https://github.com/codefresh-io/cronus/blob/master/docs/expression.md){:target="\_blank"}.
47+
1. Optional; defining the Git trigger event to simulate when the Cron trigger timer is activated.
48+
The Git trigger works the same way it does for the
49+
3550

51+
###Create a Cron trigger in UI
52+
**Before you begin**
3653

37-
Fill the following information:
54+
Review:
55+
*[Git trigger settings](#git-trigger-settings)
56+
*[Working with Git triggers](#working-with-git-triggers)
3857

39-
* Use Cron helper wizard to build a valid`cron` expression or write custom`cron` expression on the last tab.
40-
* Add a free text message, that will be sent as an additional event payload every time`cron` is executed.
58+
**How to**
59+
60+
1. In the Codefresh UI, from the sidebar, select**Pipelines**.
61+
1. Select the pipeline to which to add the trigger, and then click the**Workflow** tab.
62+
1. On the right, click**Triggers**, and then click**Add Trigger**.
63+
1. Click**Cron**, click**Next**.
4164

4265
{% include image.html
4366
lightbox="true"
44-
file="/images/pipeline/triggers/cron_trigger.png"
45-
url="/images/pipeline/triggers/cron_trigger.png"
46-
alt="Add Cron Trigger"
47-
max-width="70%"
67+
file="/images/pipeline/triggers/add-trigger-dialog.png"
68+
url="/images/pipeline/triggers/add-trigger-dialog.png"
69+
caption="Select trigger type to add"
70+
alt="Select trigger type to add"
71+
max-width="60%"
4872
%}
4973

74+
{:start="5"}
75+
1. In the**Cron Interval** tab, configure the schedule for the Cron trigger:
76+
1. Select the time interval and the frequency at which to run the pipeline.
77+
1. Use the info in the Expression Breakdown table to create a valid Cron**Expression**, or write a custom expression.
78+
1. Add a free-text message to be sent as an additional event payload every time the Cron is executed.
79+
80+
{% include image.html
81+
lightbox="true"
82+
file="/images/pipeline/triggers/cron/cron-timer-tab.png"
83+
url="/images/pipeline/triggers/cron/cron-timer-tab.png"
84+
caption="Cron trigger: Cron Interval settings"
85+
alt="Cron trigger: Cron Interval settings"
86+
max-width="60%"
87+
%}
88+
89+
{:start="6"}
90+
1. Click**Settings**, and define the Git trigger simulation options:
91+
1. From the**Simulate Trigger From** drop-down list, select the type of Git trigger to simulate.
92+
The list displays all the Git triggers defined for the pipeline.
93+
1. From the**Select Branch** drop-down list, select the branch of the repository for this build.
94+
The branches corresponding to the repo for the selected Git trigger are displayed.
95+
1. Expand**Variables**, and add or modify[environment variables]({{site.baseurl}}/docs/pipelines/variables/) for this build.
96+
1. Expand**Advanced Options** and select the overrides for this build. See[Advanced options]({{site.baseurl}}/docs/pipelines/triggers/git-triggers/#advanced-settings-for-git-triggers).
97+
98+
{% include image.html
99+
lightbox="true"
100+
file="/images/pipeline/triggers/cron/cron-timer-tab.png"
101+
url="/images/pipeline/triggers/cron/cron-timer-tab.png"
102+
caption="Cron trigger: Git trigger settings"
103+
alt="Cron trigger: Git trigger settings"
104+
max-width="60%"
105+
%}
106+
107+
{:start="7"}
108+
1. To confirm click**Done**.
109+
110+
111+
112+
113+
###Trigger Codefresh pipeline with Cron timer
114+
115+
Recurring pipeline executions are triggered according to the defined settings.
116+
117+
* If you defined only the Timer settings, the build is triggered according to the Cron expression.
118+
* If you defined both the Timer and Git Settings, the build is triggered according to the Cron expression when the Git event is triggered at the repo branch.
119+
120+
###Edit a Cron trigger in Codefresh UI
50121

51-
###Trigger Codefresh pipeline with cron timer
122+
???
52123

53-
Now,`cron` will trigger a recurrent pipeline execution based on the defined`cron expression`.
124+
##Manage Cron triggers with Codefresh CLI
54125

55-
##ManageCronTriggers withCodefresh CLI
126+
You can also createCrontriggers for pipelines via the[Codefresh CLI](https://cli.codefresh.io/){:target="\_blank"}.
56127

57-
It is also possible to usetheCodefresh Command Line client (`CLI`) to manage Cron based pipeline triggers.
128+
You first createtheCron trigger and then set up a
58129

59-
###Cron trigger
60130

61-
It is possible totriggera Codefresh CD pipeline(s) periodically, using`cron` expression.
131+
###Create Crontriggerevent via CLI
62132

63-
You can use[Codefresh CLI](https://cli.codefresh.io/){:target="\_blank"} to set up a Codefresh`cron` trigger.
133+
Create a new`cron` trigger through a Cron expression and message.
134+
To learn about supported`cron` expression formats and aliases, visit[this page](https://github.com/codefresh-io/cronus/blob/master/docs/expression.md){:target="\_blank"}.
135+
The text message is passed to linked pipelines, whenever the specified`cron` timer is triggered.
64136

65-
####Create Cron trigger-event
66137

67-
First, you need to create a new`cron``trigger-event` to define a recurrent event.
68138

69139
```sh
70-
# create DockerHubrecurrent event 'once in 20 minutes'
140+
# create DockerHubrecurring event 'once in 20 minutes'
71141
codefresh create trigger-event --type cron --kind codefresh --value expression="0 */20 * * * *" --value message="hello-once-in-20-min"
72142

73143
# on success trigger-event UID will be printed out
74144
Trigger event:"cron:codefresh:codefresh:0 */20 * * * *:hello-once-in-20-min:107e9db97062" was successfully created.
75145
```
76146

77-
When creating a`cron trigger-event`, it is possible to specify a short text message, that will be passed to linked pipelines, every time the specified`cron` timer is triggered.
78147

79-
Visit[this page](https://github.com/codefresh-io/cronus/blob/master/docs/expression.md){:target="\_blank"} to learn about the supported`cron` expression format and aliases.
80148

81-
####Set up pipeline trigger
149+
###Set up pipeline trigger
82150

83151
Now, lets create a new pipeline trigger, linking previously defined`cron``trigger-event` to one or more Codefresh pipelines.
84152

@@ -94,12 +162,13 @@ From now on, every 20 minutes Codefresh will trigger a pipeline execution for 2
94162

95163
####Cron Event payload
96164

97-
The following variableswill beavailablefor any Codefresh pipeline linked to a`cron``trigger-event`:
165+
The following variablesareavailableto any Codefresh pipeline linked to a`cron``trigger-event`:
98166

99-
-`EVENT_MESSAGE` - freetext message (specified during creation)
100-
-`EVENT_TIMESTAMP` - event timestamp in RFC 3339 format
167+
-`EVENT_MESSAGE`: Free-text message (specified during creation)
168+
-`EVENT_TIMESTAMP`: Event timestamp in RFC 3339 format
101169

102170
##Related articles
103171
[Triggers in pipelines]({{site.baseurl}}/docs/pipelines/triggers)
172+
[Variables in pipelines]({{site.baseurl}}/docs/pipelines/variables)
104173
[Creating pipelines]({{site.baseurl}}/docs/pipelines/pipelines/)
105174

‎images/icons/icon-warning.png‎

363 Bytes
Loading
45.6 KB
Loading
39.7 KB
Loading
17.5 KB
Loading

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp