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

Commitc728167

Browse files
Created skip-test-if-pipeline-is-triggered-with-cron.md
1 parent3cdc793 commitc728167

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
title:"How To: Skip Step If Pipeline Is Triggered With Cron"
3+
description:
4+
group:kb
5+
sub-group:articles
6+
toc:true
7+
kb:false
8+
ht:true
9+
common:false
10+
categories:[Pipelines]
11+
support-reviewed:2023-12-12 MB
12+
---
13+
14+
##Overview
15+
16+
You have a build that is triggered by multiple triggers, and you need to skip a certain step if the pipeline was launched using a cron trigger.
17+
18+
##Details
19+
20+
###Configure Cron Trigger Message
21+
22+
In your cron trigger configuration, set a message (e.g., "using cron") in the Message field.
23+
24+
###Implement Conditional Step
25+
26+
Utilize the EVENT_MESSAGE variable in your pipeline steps with a condition like:
27+
28+
{% raw %}
29+
30+
```yaml
31+
Freestyle:
32+
title: Running alpine image
33+
type: freestyle
34+
arguments:
35+
image: 'quay.io/codefreshplugins/alpine:3.8'
36+
commands:
37+
- echo "Displayed only when triggered by cron"
38+
when:
39+
condition:
40+
all:
41+
validateTriggerType: '"${{EVENT_MESSAGE}}" != "using cron"'
42+
```
43+
44+
{% endraw %}
45+
46+
This ensures specific steps execute only when the cron job message is different from "using cron" and pipeline is triggered by cron.
47+
48+
##Related Items
49+
50+
[Triggers in pipelines]({{site.baseurl}}/docs/pipelines/triggers/)
51+
52+
[Cron trigger event variables]({{site.baseurl}}/docs/pipelines/triggers/cron-triggers/#cron-event-payload)
53+
54+
[Conditional execution of steps]({{site.baseurl}}/docs/pipelines/conditional-execution-of-steps/)
55+
56+
[Freestyle step]({{site.baseurl}}/docs/pipelines/steps/freestyle/)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp