You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _docs/codefresh-yaml/advanced-workflows.md
+9-22Lines changed: 9 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -231,7 +231,7 @@ second_step:
231
231
232
232
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.
233
233
234
-
The reverse relationship (i.e. defining steps to be ignored) can be defined with the following syntax
234
+
The reverse relationship (i.e., defining steps to be ignored) can be defined with the following syntax
235
235
236
236
{% highlight yaml %}
237
237
second_step:
@@ -549,13 +549,12 @@ With parallel mode you are expected to define the order of steps in the yaml fil
549
549
550
550
In the next sections we describe how you can define the steps dependencies in a parallel pipeline.
551
551
552
-
###Single Stepdependencies
552
+
###Single StepDependencies
553
553
554
554
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:
555
555
556
556
1. The first step is finished with success
557
557
1. The first step is finished with failure
558
-
1. The first step was skipped
559
558
1. The first completes (regardless of exit) status
560
559
561
560
The syntax for this is the following post-condition:
@@ -570,7 +569,7 @@ second_step:
570
569
- success
571
570
{% endhighlight %}
572
571
573
-
If you want to run the second step only if the first one fails the syntax is:
572
+
If you want to run the second step only if the first one fails the syntax is:
574
573
575
574
{% highlight yaml %}
576
575
second_step:
@@ -582,18 +581,6 @@ second_step:
582
581
- failure
583
582
{% endhighlight %}
584
583
585
-
If you want to run the second step only if the first one was skipped (because its own condition said so) :
586
-
587
-
{% highlight yaml %}
588
-
second_step:
589
-
title: Second step
590
-
when:
591
-
steps:
592
-
- name: first_step
593
-
on:
594
-
- skipped
595
-
{% endhighlight %}
596
-
597
584
Finally, if you don't care about the completion status the syntax is:
598
585
599
586
{% highlight yaml %}
@@ -606,15 +593,15 @@ second_step:
606
593
- finished
607
594
{% endhighlight %}
608
595
609
-
Notice that`success` is the default behavior so if you omit the last two lines (i.e. the`on:` part) the second step
596
+
Notice that`success` is the default behavior so if you omit the last two lines (i.e., the`on:` part) the second step
610
597
will wait for the next step to run successfully.
611
598
612
599
>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.
613
600
614
601
As an example, let's assume that you have the following steps in a pipeline:
615
602
616
-
1. A build step that creates adocker image
617
-
1. A freestyle step that runs[unit tests]({{site.baseurl}}/docs/testing/unit-tests/) inside thedocker image
603
+
1. A build step that creates aDocker image
604
+
1. A freestyle step that runs[unit tests]({{site.baseurl}}/docs/testing/unit-tests/) inside theDocker image
618
605
1. A freestyle step that runs[integrations tests]({{site.baseurl}}/docs/testing/integration-tests/)*After* the unit tests, even if they fail
619
606
1. A cleanup step that runs after unit tests if they fail
620
607
@@ -800,7 +787,7 @@ steps:
800
787
In this case Codefresh will make sure that cleanup happens only when both unit and integration tests are finished.
801
788
802
789
803
-
###Customsteps dependencies
790
+
###CustomSteps Dependencies
804
791
805
792
For maximum flexibility you can define a custom conditional for a step.