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

Created skip-test-if-pipeline-is-triggered-with-cron.md#867

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
maryiaCodefresh merged 3 commits intocodefresh-io:masterfrommaryiaCodefresh:maryia-howto-cron
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
---
title: "How To: Skip step if pipeline triggered with Cron"
description:
group: kb
sub-group: articles
toc: true
kb: false
ht: true
common: false
categories: [Pipelines]
support-reviewed: 2023-12-12 MB
---

## Overview

You have a build with multiple triggers and you need to skip a certain step if the pipeline was launched using a Cron trigger.

## Details

### Configure Cron trigger message

In the **Message** field of the Cron trigger configuration settings, set a message, for example, "using cron".

### Implement Conditional Step

Use the `EVENT_MESSAGE` variable in your pipeline steps with a condition as in the following example:

{% raw %}

```yaml
Freestyle:
title: Running alpine image
type: freestyle
arguments:
image: 'quay.io/codefreshplugins/alpine:3.8'
commands:
- echo "Displayed only when triggered by cron"
when:
condition:
all:
validateTriggerType: '"${{EVENT_MESSAGE}}" != "using cron"'
```

{% endraw %}

The condition ensures that specific steps execute only when the pipeline is triggered by Cron, _and_ if the Cron job message differs from the one defined in the Message field (`using cron` in our example).

## Related Items
[Triggers in pipelines]({{site.baseurl}}/docs/pipelines/triggers/)
[Cron trigger event variables]({{site.baseurl}}/docs/pipelines/triggers/cron-triggers/#cron-event-payload)
[Conditional execution of steps]({{site.baseurl}}/docs/pipelines/conditional-execution-of-steps/)
[Freestyle step]({{site.baseurl}}/docs/pipelines/steps/freestyle/)
5 changes: 4 additions & 1 deletion_docs/pipelines/triggers/cron-triggers.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -72,7 +72,7 @@ There are two parts to creating a Cron trigger in the UI:
1. (Optional) Selecting additional options:
* 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.
* Variables to populate for the build
* Caching, volumeresuse and notification behavior to override for the build
* Caching, volumereuse and notification behavior to override for the build



Expand DownExpand Up@@ -198,6 +198,9 @@ For example, `@every 1h30m10s` would indicate a schedule that triggers every 1 h
>**NOTE:**
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.

### Conditional triggers for Cron jobs
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/).

## Cron triggers with Codefresh CLI

>**NOTE**:
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp