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

Commit59ae693

Browse files
committed
upper case predefined schedule
1 parent75d00ab commit59ae693

File tree

1 file changed

+47
-39
lines changed

1 file changed

+47
-39
lines changed

‎_docs/pipelines/triggers/cron-triggers.md‎

Lines changed: 47 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ Cron triggers offer a way to run Codefresh pipelines based on a specific time sc
1616

1717
Integrate additional settings in the Cron trigger such as simulating a Git event to enrich pipelines with repository details, adding/customizing environment variables, and caching, volume reuse, and notification configurations for the build.
1818

19-
By integrating these additional options, Cron triggers can initiate pipeline executions at the predefined time intervals and at the same time populate the pipeline with repo and branch information from the Git trigger, required environment variables, and specialized behavior, for the build.
19+
By integrating these additional options, Cron triggers can initiate pipeline executions at the predefined time intervals and at the same time populate the pipeline with repo and branch information from the Git trigger, required environment variables, and specialized behavior, for the build.
2020

2121
Create and manage Cron triggers for pipelines through[Codefresh UI](#cron-triggers-in-codefresh-ui), as described in this article.
2222
For the specifications, see[Cron trigger specifications in pipelines]({{site.baseurl}}/docs/integrations/codefresh-api/#cron-triggers).
2323

2424
>**NOTE**
2525
Cron triggers are created in the UTC timezone.
2626

27+
##Legacy Cron triggers in Codefresh
2728

28-
##Legacy Cron triggers in Codefresh
2929
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.
3030

3131
{% include image.html
@@ -38,8 +38,9 @@ max-width="60%"
3838
%}
3939

4040
**Migrate legacy trigger**
41+
4142
* Click the**Edit** icon to view the trigger.
42-
* To migrate, click**Convert**.
43+
* To migrate, click**Convert**.
4344

4445
{% include image.html
4546
lightbox="true"
@@ -50,6 +51,7 @@ alt="Migrate legacy Cron trigger in Codefresh UI"
5051
max-width="60%"
5152
%}
5253
Codefresh migrates the legacy Cron trigger and displays a Trigger updated successfully message.
54+
5355
* Open the trigger displays the Settings tab with additional options.
5456

5557
{% include image.html
@@ -61,26 +63,27 @@ alt="Cron trigger after migration with Settings tab"
6163
max-width="60%"
6264
%}
6365

64-
6566
##Cron triggers in Codefresh UI
6667

6768
Create and manage Cron triggers for pipelines in the Codefresh UI.
6869

6970
There are two parts to creating a Cron trigger in the UI:
71+
7072
1. Defining the schedule for the trigger
7173
To learn about supported`cron` expression formats and aliases, see[Cron expression formats](#cron-expression-formats) in this article.
7274
1. (Optional) Selecting additional options:
73-
* Git trigger event to simulate when the Cron trigger timer is activated. The pipeline is populated with the information from the Git repo such as the repo URL, branch name, latest commit information, including the date and author of the commit.
74-
* Variables to populate for the build
75-
* Caching, volume reuse and notification behavior to override for the build
76-
7775

76+
* Git trigger event to simulate when the Cron trigger timer is activated. The pipeline is populated with the information from the Git repo such as the repo URL, branch name, latest commit information, including the date and author of the commit.
77+
* Variables to populate for the build
78+
* Caching, volume reuse and notification behavior to override for the build
7879

7980
##How to: Create a Cron trigger in UI
81+
8082
**Before you begin**
8183

8284
Review:
83-
*[Git trigger settings]({{site.baseurl}}/docs/pipelines/triggers/git-triggers/#git-trigger-settings)
85+
86+
*[Git trigger settings]({{site.baseurl}}/docs/pipelines/triggers/git-triggers/#git-trigger-settings)
8487
*[Working with Git triggers]({{site.baseurl}}/docs/pipelines/triggers/git-triggers/#working-with-git-triggers)
8588
*[Cron expression formats](#cron-expression-formats)
8689

@@ -101,6 +104,7 @@ max-width="60%"
101104
%}
102105

103106
{:start="5"}
107+
104108
1. In the**Cron Interval** tab, configure the schedule for the Cron trigger:
105109
1. Select the time interval and the frequency at which to run the pipeline.
106110
1. Use the info in the Expression Breakdown table to create a valid Cron**Expression**, or write a custom expression.
@@ -116,10 +120,11 @@ max-width="60%"
116120
%}
117121

118122
{:start="6"}
123+
119124
1. Click**Settings**.
120125
1. Define the Git trigger simulation options:
121126
1. From the**Simulate Trigger From** drop-down list, select the type of Git trigger to simulate.
122-
The list displays all the Git triggers defined for the pipeline.
127+
The list displays all the Git triggers defined for the pipeline.
123128
1. From the**Select Branch** drop-down list, select the branch of the repository for this build.
124129
1. Expand**Variables**, and add or modify[environment variables]({{site.baseurl}}/docs/pipelines/variables/) for this build.
125130
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).
@@ -134,13 +139,14 @@ max-width="60%"
134139
%}
135140

136141
{:start="7"}
137-
1. To confirm click**Done**.
138-
* If you defined only the Timer settings, the build is triggered according to the Cron expression.
139-
* If you defined both the Timer and additional Settings, the build is triggered according to the Cron expression, and depending on the settings, the pipeline is populated with the information from the Git repo, additional variables, and notifications when configured.
140142

143+
1. To confirm click**Done**.
144+
145+
* If you defined only the Timer settings, the build is triggered according to the Cron expression.
146+
* If you defined both the Timer and additional Settings, the build is triggered according to the Cron expression, and depending on the settings, the pipeline is populated with the information from the Git repo, additional variables, and notifications when configured.
141147

142148
{{site.data.callout.callout_tip}}
143-
**TIP**
149+
**TIP**
144150
To edit a Cron trigger after creating it, click the Edit icon.
145151
{{site.data.callout.end}}
146152

@@ -149,9 +155,11 @@ To edit a Cron trigger after creating it, click the Edit icon.
149155
A Cron expression represents a set of time fields through five space-separated fields. You can also use predefined schedules or fixed interval scheduling in place of Cron expressions.
150156

151157
###Cron expression fields
158+
152159
The table below describes the fields you can define in a Cron expression.
153160

154161
{: .table .table-bordered .table-hover}
162+
155163
Field | Mandatory | Allowed values | Allowed special characters
156164
|----------| ----------| --------------| --------------------------|
157165
Seconds | No | 0-59 | * / , -|
@@ -161,34 +169,34 @@ Day of month | Yes | 1-31 | * / , - ?|
161169
Month | Yes | 1-12 or JAN-DEC | * / , -|
162170
Day of week | Yes | 0-6 or SUN-SAT | * / , - ?|
163171

164-
165172
###Special characters in Cron expressions
173+
166174
The table below describes the purpose of the special characters in a Cron expression.
167175

168176
{: .table .table-bordered .table-hover}
169-
|Special Character| Description|
170-
|----------| ----------|
177+
178+
|Special Character| Description|
179+
|----------| ----------|
171180
|**Asterisk** (`*`)| Indicates that the Cron expression will match for all values of the field.<br>Using an asterisk in the 5th field (month), would indicate every month.|
172181
|**Slash** (`/`)| Slashes are used to describe increments of ranges. <br>For example`3-59/15` in the 1st field (minutes) would indicate the 3rd minute of the hour and every 15 minutes thereafter. <br>The form`*\/...` is equivalent to the form`first-last/...`, that is, an increment over the largest possible range of the field. <br>The form`N/...` is accepted as meaning`N-MAX/...`, that is, starting at`N`, use the increment until the end of that specific range. It does not wrap around.|
173182
|**Comma** (`,`)| Commas are used to separate items of a list. For example, using`MON,WED,FRI` in the 5th field (day of week) would mean Mondays, Wednesdays and Fridays.|
174183
|**Hyphen** (`-`)| Hyphens are used to define ranges. For example,`9-17` would indicate every hour between 9am and 5pm inclusive.|
175184
|**Question mark** (`?`)| Question marks can be used instead of asterisks (`*`) for leaving either day-of-month or day-of-week blank.|
176185

177-
178186
###Predefined scheduling for Cron jobs
179187

180188
You can use one of several predefined schedules instead of a Cron expression.
181189
The table below describes the predefined schedules supported.
182190

183191
{: .table .table-bordered .table-hover}
192+
184193
|Predefined schedule| Description| Equivalent to|
185194
|-----| -----------| -------------|
186-
|@yearly (or@annually)| Run once a year, midnight, Jan. 1st| 0 0 0 1 1 *|
187-
|@monthly| Run once a month, midnight, first of month| 0 0 0 1 * *|
188-
|@weekly| Run once a week, midnight on Sunday| 0 0 0 * * 0|
189-
|@daily (or@midnight)| Run once a day, midnight| 0 0 0 * * *|
190-
|@hourly| Run once an hour, beginning of hour| 0 0 * * * *|
191-
195+
|@YEARLY (or@ANNUALLY)| Run once a year, midnight, Jan. 1st| 0 0 0 1 1 *|
196+
|@MONTHLY| Run once a month, midnight, first of month| 0 0 0 1**|
197+
|@WEEKLY| Run once a week, midnight on Sunday| 0 0 0** 0|
198+
|@DAILY (or@MIDNIGHT)| Run once a day, midnight| 0 0 0** *|
199+
|@HOURLY| Run once an hour, beginning of hour| 0 0****|
192200

193201
###Fixed interval scheduling for Cron jobs
194202

@@ -200,49 +208,49 @@ For example, `@every 1h30m10s` would indicate a schedule that triggers every 1 h
200208
The interval does not take the runtime of the job into account. For example, if a job takes three minutes to run, and it is scheduled to run every five minutes, it will have only two minutes of idle time between each run.
201209

202210
###Conditional triggers for Cron jobs
211+
203212
Take a look at our Knowledge Base how-to:[Skip pipeline step if triggered by Cron job]({{site.baseurl}}/docs/kb/articles/skip-test-if-pipeline-is-triggered-with-cron/).
204213

205214
##Cron triggers with Codefresh CLI
206215

207216
>**NOTE**
208-
This section is relevant only for legacy Cron triggers and will be deprecated.
217+
This section is relevant only for legacy Cron triggers and will be deprecated.
209218

210219
You can also create and manage Cron triggers for pipelines via the[Codefresh CLI](https://cli.codefresh.io/){:target="\_blank"}.
211220

212-
213-
214221
###Create Cron trigger event via CLI
215222

216223
Create a new`cron` trigger by defining a Cron expression and message.
217224
To learn about supported`cron` expression formats and aliases, see[Cron expression formats](#cron-expression-formats) in this article.
218225
The text message is passed to linked pipelines, whenever the specified`cron` timer is triggered.
219226

220-
221-
222227
{% highlight yaml %}
223228
{% raw %}
229+
224230
#create recurring event 'once in 20 minutes'
225-
codefresh create trigger-event --type cron --kind codefresh --value expression="0*/20 * * **" --value message="hello-once-in-20-min"
231+
232+
codefresh create trigger-event --type cron --kind codefresh --value expression="0*/20****" --value message="hello-once-in-20-min"
226233

227234
#on success trigger-event UID will be printed out
228-
Trigger event: "cron:codefresh:codefresh:0*/20 * * **:hello-once-in-20-min:107e9db97062" was successfully created.
235+
236+
Trigger event: "cron:codefresh:codefresh:0*/20****:hello-once-in-20-min:107e9db97062" was successfully created.
229237
{% endraw %}
230238
{% endhighlight %}
231239

232-
233-
234240
###Set up pipeline trigger
235241

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

238-
239244
{% highlight yaml %}
240245
{% raw %}
246+
241247
#create trigger, linking trigger-event UID to the pipeline UID
242-
codefresh create trigger "cron:codefresh:codefresh:0*/20 * * **:hello-once-in-20-min:107e9db97062" 7a5622e4b1ad5ba0018a3c9c
248+
249+
codefresh create trigger "cron:codefresh:codefresh:0*/20****:hello-once-in-20-min:107e9db97062" 7a5622e4b1ad5ba0018a3c9c
243250

244251
#create another trigger, linking the same trigger-event to another pipeline
245-
codefresh create trigger "cron:codefresh:codefresh:0*/20 * * **:hello-once-in-20-min:107e9db97062" 4a5634e4b2cd6baf021a3c0a
252+
253+
codefresh create trigger "cron:codefresh:codefresh:0*/20****:hello-once-in-20-min:107e9db97062" 4a5634e4b2cd6baf021a3c0a
246254
{% endraw %}
247255
{% endhighlight %}
248256

@@ -252,12 +260,12 @@ From now on, Codefresh will trigger a pipeline execution for two pipelines linke
252260

253261
The following variables are available to any Codefresh pipeline linked to a Cron trigger event:
254262

255-
-`EVENT_MESSAGE`: Free-text message (specified during creation)
256-
-`EVENT_TIMESTAMP`: Event timestamp in RFC 3339 format
263+
*`EVENT_MESSAGE`: Free-text message (specified during creation)
264+
*`EVENT_TIMESTAMP`: Event timestamp in RFC 3339 format
257265

258266
##Related articles
267+
259268
[Triggers in pipelines]({{site.baseurl}}/docs/pipelines/triggers/)
260269
[Cron trigger specifications]({{site.baseurl}}/docs/integrations/codefresh-api/#cron-triggers/)
261270
[Variables in pipelines]({{site.baseurl}}/docs/pipelines/variables/)
262271
[Creating pipelines]({{site.baseurl}}/docs/pipelines/pipelines/)
263-

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp