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/hooks.md
+11-4Lines changed: 11 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,15 +7,22 @@ toc: true
7
7
8
8
Pipeline hooks allow you to run specific actions at the end and the beginning of the pipeline as well as before/after a step.
9
9
10
-
##Pipeline hooks
11
-
12
-
Codefresh allows you to run a specific step before each pipeline as well as after it has finished. Each hook is similar to a[freestyle step]({{site.baseurl}}/docs/codefresh-yaml/steps/freestyle/) as you need to define:
10
+
Hooks can be a[freestyle step]({{site.baseurl}}/docs/codefresh-yaml/steps/freestyle/) as you need to define:
13
11
14
-
1. A Docker image that will be used to run specific commands
12
+
1. A Docker image that will be used to run specific commands.
15
13
1. One or more commands to run within the context of that Docker image.
16
14
17
15
For simple commands we suggest you use a small image such as`alpine`, but any Docker image can be used in hooks.
18
16
17
+
Also, Hooks can use[steps/plugins](https://steps.codefresh.io) and need to define:
18
+
19
+
1. The type field for the step/plugin.
20
+
1. The arguments needed for the step/plugin.
21
+
22
+
##Pipeline hooks
23
+
24
+
Codefresh allows you to run a specific step before each pipeline as well as after it has finished.
25
+
19
26
###Running a step at the end of the pipeline
20
27
21
28
You can easily run a step at the end of pipeline, that will execute even if one of the steps have failed (and thus the pipeline is stopped in middle):