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

Fix parallel#253

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
kostis-codefresh merged 3 commits intomasterfromfix-parallel
Apr 7, 2021
Merged
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
31 changes: 9 additions & 22 deletions_docs/codefresh-yaml/advanced-workflows.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -231,7 +231,7 @@ second_step:

In the example above, if integration and/or acceptance tests fail, the whole pipeline will continue, because we have defined that only the results of unit test matter for the whole parallel step.

The reverse relationship (i.e. defining steps to be ignored) can be defined with the following syntax
The reverse relationship (i.e., defining steps to be ignored) can be defined with the following syntax

{% highlight yaml %}
second_step:
Expand DownExpand Up@@ -549,13 +549,12 @@ With parallel mode you are expected to define the order of steps in the yaml fil

In the next sections we describe how you can define the steps dependencies in a parallel pipeline.

### Single Stepdependencies
### Single StepDependencies

At the most basic level, you can define that a step *depends on* the execution of another step. This dependency is very flexible as Codefresh allows you run a second step once:

1. The first step is finished with success
1. The first step is finished with failure
1. The first step was skipped
1. The first completes (regardless of exit) status

The syntax for this is the following post-condition:
Expand All@@ -570,7 +569,7 @@ second_step:
- success
{% endhighlight %}

If you want to run the second step only if the first one fails the syntax is:
If you want to run the second step only if the first one fails the syntax is:

{% highlight yaml %}
second_step:
Expand All@@ -582,18 +581,6 @@ second_step:
- failure
{% endhighlight %}

If you want to run the second step only if the first one was skipped (because its own condition said so) :

{% highlight yaml %}
second_step:
title: Second step
when:
steps:
- name: first_step
on:
- skipped
{% endhighlight %}

Finally, if you don't care about the completion status the syntax is:

{% highlight yaml %}
Expand All@@ -606,15 +593,15 @@ second_step:
- finished
{% endhighlight %}

Notice that `success` is the default behavior so if you omit the last two lines (i.e. the `on:` part) the second step
Notice that `success` is the default behavior so if you omit the last two lines (i.e., the `on:` part) the second step
will wait for the next step to run successfully.

>Also notice that the name `main_clone` is reserved for the automatic clone that takes place in the beginning of pipelines that are linked to a git repository. You need to define which steps depend on it (probably the start of your graph) so that `git checkout` happens before the other steps.

As an example, let's assume that you have the following steps in a pipeline:

1. A build step that creates adocker image
1. A freestyle step that runs [unit tests]({{site.baseurl}}/docs/testing/unit-tests/) inside thedocker image
1. A build step that creates aDocker image
1. A freestyle step that runs [unit tests]({{site.baseurl}}/docs/testing/unit-tests/) inside theDocker image
1. A freestyle step that runs [integrations tests]({{site.baseurl}}/docs/testing/integration-tests/) *After* the unit tests, even if they fail
1. A cleanup step that runs after unit tests if they fail

Expand DownExpand Up@@ -800,7 +787,7 @@ steps:
In this case Codefresh will make sure that cleanup happens only when both unit and integration tests are finished.


### Customsteps dependencies
### CustomSteps Dependencies

For maximum flexibility you can define a custom conditional for a step.

Expand DownExpand Up@@ -861,8 +848,8 @@ my_step:
when:
condition:
any:
myCondition: steps.MyLoadTesting.result ==success
myOtherCondition: steps.MyCleanupStep.result ==skipped
myCondition: steps.MyLoadTesting.result =='success'
myOtherCondition: steps.MyCleanupStep.result =='finished'
{% endhighlight %}

You can also use conditions in the success criteria for a parallel step. Here is an example
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp