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

Commitad229ed

Browse files
committed
Add feedback from review
Implemented feedback from Francisco's review
1 parent7528ce9 commitad229ed

File tree

3 files changed

+51
-25
lines changed

3 files changed

+51
-25
lines changed

‎_docs/promotions/promotion-hooks.md‎

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ toc: true
66
---
77

88

9-
##About promotionhooks
9+
##Promotionhooks overview
1010

11-
Promotion hooks in GitOps Cloud are specialized Promotion Workflows that run at key stages of a product release. A product release is created when a Promotion Flow is triggered, either manually or automatically.
11+
Promotion hooks in GitOps Cloud are specialized Promotion Workflows that run at key stages of a product release to provide information on the release and its environments. A product release is created when a Promotion Flow is triggered, either manually or automatically.
1212

1313
{% include
1414
image.html
@@ -36,7 +36,7 @@ Promotion hooks can run at different stages of a product release:
3636
***On success**: When the promotion completes successfully in an environment
3737
***On failure**: When the promotion fails in an environment
3838

39-
See[Assigning promotion hooks in Promotion Flows](#assigning-promotion-hooks-in-promotion-flows).
39+
See[Assigning promotion hooks in Promotion Flows](#assigning-promotion-hooks-in-promotion-flows). For the YAML specifications of promotion hooks when assigned, see[Promotion Flow YAML]({{site.baseurl}}/docs/promotions/yaml/promotion-flow-crd/).
4040

4141
#####Use cases for promotion hooks
4242
* Auditing and visibility
@@ -48,6 +48,9 @@ See [Assigning promotion hooks in Promotion Flows](#assigning-promotion-hooks-in
4848
* Integration with external tools
4949
Automate updates to ticketing systems such as Jira, or observability platforms.
5050

51+
* Approvals from external systems
52+
Handle approvals required from external systems such as ServiceNow by pausing the promotion through a promotion hook when a PR pause is not feasible.
53+
5154
Explore examples in[Codefresh Hub for Argo](https://codefresh.io/argohub/){:target="\_blank"}.
5255

5356
#####Arguments in promotion hooks
@@ -57,7 +60,8 @@ A default set of arguments are available to all Promotion Workflows with hooks.
5760

5861
The table lists key differences between Promotion Workflows containing hooks and Promotion (Pre- and Post-Action) Workflows.
5962

60-
|**Feature**|**Promotion Hooks in Workflows**|**Pre- and Post-Action Workflows**|
63+
||**Promotion Workflows**|
64+
|**Feature**|**Promotion Hook Workflows**|**Pre- and Post-Action Workflows**|
6165
|----------------|----------------------|-----------------------------------------------|
6266
|**Purpose**| Provide information on the release.| Provide information on promoted changes in applications within an environment.|
6367
|**Execution**| Run at release start, end (success, failure), or per environment (start, success, failure).| Run for each application in an environment before and after promotion.|
@@ -260,15 +264,26 @@ spec:
260264

261265
## Assigning promotion hooks in Promotion Flows
262266

263-
Assign Promotion Workflows with promotion hooksin the Promotion Flow for the release or environments:
267+
Assign Promotion Workflows with promotion hooksto the Promotion Flow for the release or for one or more environments:
264268
* Release-level hooks run before the trigger environment and after the final target environment.
265269
* Environment-level hooks run on entry to or exit from each environment.
266270
* Multiple hooks can run based the stage in the product release they are configured. Promotion failure for an environment will run both On Fail hooks if configured the environment and for the release.
267271

272+
You can also define them in the YAML manifest, as described in [Promotion Flow YAML]({{site.baseurl}}/docs/promotions/yaml/promotion-flow-crd/).
273+
268274

275+
{% include
276+
image.html
277+
lightbox="true"
278+
file="/images/gitops-promotions/hooks/assign-promotion-hooks-in-ui.png"
279+
url="/images/gitops-promotions/hooks/assign-promotion-hooks-in-ui.png"
280+
alt="Assign promotion hooks in Promotion Flow"
281+
caption="Assign promotion hooks in Promotion Flow"
282+
max-width="60%"
283+
%}
269284

270-
>**NOTE**
271-
You cannot assign a Promotion Hook Workflow to the Trigger Environment itself.
285+
>**NOTE**
286+
You cannot assign a Promotion Hook Workflow to the Trigger Environment itself.
272287

273288

274289

‎_docs/promotions/service-accounts-promotion-workflows.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@ When a GitOps Runtime is installed, GitOps Cloud automatically creates the requi
3131
*`PATCH`
3232

3333

34-
##Custom options for service account andservicerole
34+
##Custom options for service account and role
3535

36-
If you need aservicerole with additional permissions or a new service account, do one of the following:
36+
If you need a role with additional permissions or a new service account, do one of the following:
3737

3838
***Use a custom role**
3939
Create a new service role with the required permissions, and bind it to the default service account,`cf-default-promotion-workflows-sa`.
4040

4141
***Use a custom service account**
4242
Use your own service account, and bind it to the default service role,`cf-default-promotion-workflows-role`.
4343

44-
##Example of service account and service role
44+
##Example ofaservice account and role
4545

4646
```yaml
4747
apiVersion:v1

‎_docs/promotions/yaml/promotion-flow-crd.md‎

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ toc: true
99
---
1010

1111

12-
Codefresh provides two options for defining manifests for promotion entities:Form mode and YAML mode.
12+
Codefresh provides two options for defining manifests for promotion entities:[Chart mode]({{site.baseurl}}/docs/promotions/promotion-flow/) and YAML mode.
1313

1414
If you prefer working with YAML, create the manifest using the example Promotion Flow YAML below, and the table with field descriptions.
1515

@@ -24,22 +24,27 @@ kind: PromotionFlow
2424
metadata:
2525
name:global-parallel-flow
2626
spec:
27-
properties:
28-
triggerEnvironment:dev# name of the initial environment that triggers promotion flow
29-
steps:# one or more environments across which to promote product
30-
-environment:qa# target environment
31-
dependsOn:# environment to successfully promote before triggering promotion for target
32-
-dev
27+
triggerEnvironment:dev
28+
steps:
3329
-environment:staging
3430
dependsOn:
35-
-qa
31+
-dev
3632
policy:
37-
preAction:pre-action# optional; the promotion workflow to run before the promotion action
38-
postAction:post-action# optional; the promotion workflow to run after the promotion action
39-
action:commit# required; the promotion action to execute
33+
action:commit
34+
hooks:
35+
onStart:slack-start-hook
36+
onSuccess:simple-fail
37+
onFail:jira-open-bug
4038
-environment:production
4139
dependsOn:
4240
-staging
41+
policy:
42+
action:commit
43+
hooks:
44+
onStart:slack-start-hook
45+
onSuccess:success-hook-test
46+
onFail:slack-fail-hook
47+
4348
```
4449

4550
##Promotion Flow YAML field descriptions
@@ -51,12 +56,18 @@ spec:
5156
|`spec.steps`| The step in the Promotion Flow that defines the list of target environments and their dependencies. <br>At least one target environment and dependency must be defined.| array| Required|
5257
|`spec.steps.environment`| The name of the specific target environment for which to trigger the promotion.| string| Required|
5358
|`spec.steps.environment.dependsOn`| One or more environments that must be successfully promoted before promotion can be triggered in the succeeding environments.| array| Required|
54-
|`spec.steps.policy`| The Pre-Action Workflow, Action, and Post-Action Workflow to implement for the Promotion Policy through the `action`, `preAction`, and `postAction` attributes. <br>The Action attribute is required.<br>An `policy` attribute defined here overrides global Policies that match the product/environment. See [Promotion Policy implementation logic]({{site.baseurl}}/docs/promotions/promotion-policy/#promotion-policy-implementation-logic) for information on how they are applied. | object | Optional |
55-
| `spec.steps.policy.action` | The action that should trigger the promotion in the target environment for this Promotion Policy.<br>Can be one of the following:{::nomarkdown}<ul><li><code class="highlighter-rouge">commit</code>:Executes a commit operation on the target application.</li><li><code class="highlighter-rouge">pr</code>: Executes a commit and opens a pull request for the target application.<br>Useful when you need manual approval before commit.</li><li><code class="highlighter-rouge">none</code>: Does not execute any action on the target application.<br>In this case, the Post-Action workflow must include a step that is equivalent </li></ul>{:/}| string | Required |
56-
| `spec.steps.policy.preAction` | The name of the Promotion Workflow to execute _before_ `spec.steps.policy.action`. | string | Optional |
57-
| `spec.steps.policy.postAction` | The name of the Promotion Workflow to execute _after_ `spec.steps.policy.action`. | string | Optional |
59+
|`spec.steps.environment.policy`| The Pre-Action Workflow, Action, and Post-Action Workflow to implement for the Promotion Policy through the`action`,`preAction`, and`postAction` attributes. <br>The Action attribute is required.<br>An`policy` attribute defined here overrides global Policies that match the product/environment. See[Promotion Policy implementation logic]({{site.baseurl}}/docs/promotions/promotion-policy/#promotion-policy-implementation-logic) for information on how they are applied.| object| Optional|
60+
|`spec.steps.environment.policy.preAction`| The name of the Promotion Workflow to execute_before_`spec.steps.policy.action`.| string| Optional|
61+
|`spec.steps..environment.policy.postAction`| The name of the Promotion Workflow to execute_after_`spec.steps.policy.action`.| string| Optional|
62+
|`spec.steps.environment.policy.action`| The action that should trigger the promotion in the target environment for this Promotion Policy.<br>Can be one of the following:{::nomarkdown}<ul><li><codeclass="highlighter-rouge">commit</code>: Executes a commit operation on the target application.</li><li><codeclass="highlighter-rouge">pr</code>: Executes a commit and opens a pull request for the target application.<br>Useful when you need manual approval before commit.</li><li><codeclass="highlighter-rouge">none</code>: Does not execute any action on the target application.<br>In this case, the Post-Action workflow must include a step that is equivalent </li></ul>{:/}| string| Required|
63+
|`spec.steps.environment.hooks`| The promotion hooks to run for the_environment_, and can be any of the following:{::nomarkdown}<ul><li><codeclass="highlighter-rouge">onStart</code>: The promotion hook to run when the promotion reaches the environment.</li><li><codeclass="highlighter-rouge">onSuccess</code>: The promotion hook to run when the promotion completes successfully in the environment.</li><li><codeclass="highlighter-rouge">onFail</code>: The promotion hook to run when the promotion fails in the environment.</li></ul>{:/}| string| Optional|
64+
|`spec.hooks`| The promotion hooks to run for the_product release_, and can be any of the following:{::nomarkdown}<ul><li><codeclass="highlighter-rouge">onStart</code>: The promotion hook to run when the release is initiated.</li><li><codeclass="highlighter-rouge">onSuccess</code>: The promotion hook to run when the release completes successfully.</li><li><codeclass="highlighter-rouge">onFail</code>: The promotion hook to run when the release fails.</li></ul>{:/}| string| Optional|
65+
66+
5867

5968
##Related articles
69+
[Configure Promotion Flows]({{site.baseurl}}/docs/promotions/promotion-flow/)
70+
[Configure hooks in Promotion Workflows]({{site.baseurl}}/docs/promotions/promotion-hooks/)
6071
[Product YAML]({{site.baseurl}}/docs/promotions/yaml/product-crd/)
6172
[Promotion Policy YAML]({{site.baseurl}}/docs/promotions/yaml/promotion-policy-crd/)
6273
[Promotion Template YAML]({{site.baseurl}}/docs/promotions/yaml/promotion-template-crd/)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp