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

Commit8dbe1d9

Browse files
NimRegevLuke Goodfellow
and
Luke Goodfellow
authored
Kb how to cleanup (#950)
* Remove how to KB articlesRemoved unused invalid How to KB articles after porting content to core doc as relevant* Remove How tosCleaned up unused Howtos* removed some additional KB* Update create-codefresh-account.md* Refactor how tosRefactored how tos 1 to 5 in order of list* Update How Tos continuedEdited more How Tos for consistency* Update how to articlesContinued to edit how to articles---------Co-authored-by: Luke Goodfellow <goodfellow.luke@icloud.com>
1 parent4e5c5d5 commit8dbe1d9

9 files changed

+123
-95
lines changed

‎_docs/kb/articles/check-env-vars-in-conditionals.md‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,9 @@ categories: [Pipelines]
1111
support-reviewed:2023-04-18 LG
1212
---
1313

14-
##Overview
14+
This article outlines how to execute a specific step conditionally based on the presence or absence of a variable in Codefresh pipelines, enabling branching logic within a single pipeline.
1515

16-
You are trying to run a specific step only if a variable is set. You are trying to have branching logic in one pipeline.
17-
18-
19-
This condition determines how values are substituted for variables, when and if referenced variables do not exist in the pipeline definitions. In such cases, Codefresh retains the variable name string as-is, without substituting it with a value.
20-
16+
The condition determines how variable values are substituted within the pipeline's build when these variables are not defined in the pipeline configuration. In such instances, Codefresh maintains the variable name string unchanged, without replacing it with a value.
2117

2218
The following condition:
2319

@@ -30,9 +26,11 @@ The following condition:
3026

3127
evaluates to`true` if`CF_RELEASE_TAG` does not exist, and`false` if it does exist.
3228

33-
##Details
29+
##How to
3430

35-
1. Using the following syntax, you can check whether a variable exists for the current build:
31+
#####Check if variable exists for the current build
32+
33+
Use the following syntax:
3634

3735
{% raw %}
3836

@@ -45,7 +43,9 @@ evaluates to `true` if `CF_RELEASE_TAG` does not exist, and `false` if it does e
4543

4644
{% endraw %}
4745

48-
2. The following syntax can be used to check for a specific value:
46+
#####Check if variable has a specific value
47+
48+
Use the following syntax:
4949

5050
{% raw %}
5151

@@ -58,9 +58,9 @@ evaluates to `true` if `CF_RELEASE_TAG` does not exist, and `false` if it does e
5858

5959
{% endraw %}
6060

61-
3. If desired, you can combinemultiple checks.
61+
Combinemultiple checks as required.
6262

6363

6464

65-
## RelatedItems
66-
[Conditional execution of steps]({{site.baseurl}}/docs/pipelines/conditional-execution-of-steps/)
65+
##Relatedarticles
66+
[Conditional execution of steps]({{site.baseurl}}/docs/pipelines/conditional-execution-of-steps/)
Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title:"How To: Check out onlythe PR merge commit, and not the HEAD ofthe target branch"
2+
title:"How To: Check out onlypull request merge commit for target branch instead ofHEAD"
33
description:
44
group:kb
55
sub-group:articles
@@ -11,22 +11,24 @@ categories: [Pipelines]
1111
support-reviewed:2023-05-04 LG
1212
---
1313

14-
##Overview
14+
This article describes how to check out only the merge commit of a PR (Pull Request) instead of the HEAD of the target branch.
1515

16-
Sometimes, when you re-run a pipeline based on a PR you might find your tests that passed the first time failing the second time. This can happen because the default behavior of your pipeline is to run based on a merge of the PR and the HEAD of the target branch - so it includes the latest changes to HEAD that may not have present when the PR itself was first made.
16+
When re-running a pipeline based on a PR, tests that passed the previous fails during the rerun.
17+
This can happen because the default behavior of the pipeline is to run based on a merge of the PR and the HEAD of the target branch. This behavior includes the latest changes to HEAD which may not have been present when the PR itself was created.
1718

1819
##Details
1920

20-
If you want a pipelineto only runagainst the target branch asit wasat the time of thepull request, you can clone your repository using the exact SHA of the merge request.
21+
To only run the pipeline against the target branch as at the time of thePR, clone your repository using the exact SHA of the merge request.
2122

22-
WhenCodefreshis triggered by aPull Request, your pipeline will haveaccess tosomeadditional variables[1]. This includesCF_PULL_REQUEST_MERGED_COMMIT_SHA, which is the commit SHA on the base branch after thepull request was merged.
23+
Whenthe pipelineis triggered by aPR, it hasaccess to additional variablesincluding`CF_PULL_REQUEST_MERGED_COMMIT_SHA`, which is the commit SHA on the base branch after thePR was merged.
2324

24-
You can set up your pipeline to test and see if this variable exists[2], and depending on it's existence do two different clone steps. One clone as your existing clone if the variable is not there, or a second clone step if it is that uses CF_PULL_REQUEST_MERGED_COMMIT_SHA in the`revision` field of your clone step[3] to check out your codebase as it was at the exact moment of the PR with the PR merged into it.
25+
Configure[conditional execution for the pipeline]({{site.baseurl}}/docs/pipelines/conditional-execution-of-steps/) to check if the`CF_PULL_REQUEST_MERGED_COMMIT_SHA` variable exists.
26+
Depending on result, execute one of two`git-clone` steps:
27+
* If the variable exists, specify it in the`revision` field of your`git-clone` step. This ensures that your codebase is checked out to the state it was at the precise moment the PR was merged.
28+
* If the variable does not exist, continue with your regular clone process.
2529

26-
##Related Items
2730

28-
[1]<https://codefresh.io/docs/docs/pipelines/variables/#github-pull-request-variables>
29-
30-
[2]<https://codefresh.io/docs/docs/kb/articles/check-env-vars-in-conditionals/>
31-
32-
[3]<https://codefresh.io/docs/docs/pipelines/steps/git-clone/#fields>
31+
##Related articles
32+
[GitHub Pull Request variables]({{site.baseurl}}/docs/pipelines/variables/#github-pull-request-variables)
33+
[Check environment variable value or existence in conditionals]({{site.baseurl}}/kb/articles/check-env-vars-in-conditionals)
34+
[Fields for`git-clone` step]({{site.baseurl}}/docs/pipelines/steps/git-clone/#fields)

‎_docs/kb/articles/check-potentially-unstable-service.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ This article describes how to check for a service that may be inaccessible for a
1919

2020
##How to
2121

22-
* In the pipline step, add the`retry` attribute, as in the following example:
22+
* In the pipeline step, add the`retry` attribute, as in the following example:
23+
24+
2325

2426
```yaml
2527
steps:
@@ -33,7 +35,8 @@ steps:
3335
exponentialFactor:2
3436
```
3537
36-
>**NOTE**
38+
39+
>**NOTE**
3740
Every retry attempt uses up one of your concurrent builds. For this reason, we suggest limiting the amount of retries.
3841
3942
## Related articles

‎_docs/kb/articles/clone-backup-pipelines-projects.md‎

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,30 @@ categories: [Pipelines, CLI]
1111
support-reviewed:2023-04-18 LG
1212
---
1313

14-
##Overview
1514

16-
You would liketo back up yourPipelines orProjects locally.
15+
This article describes howto back up yourpipelines orprojects locally.
1716

18-
##Details
17+
##How to
1918

20-
You will need to have the[Codefresh CLI installed](https://codefresh-io.github.io/cli/installation/). When installed, run the following command:
19+
#####Prerequisite
20+
[Install the Codefresh CLI](https://codefresh-io.github.io/cli/installation/).
2121

22-
{% raw %}
22+
#####Commands
23+
24+
**Back up the pipeline**
2325

26+
{% raw %}
2427
```shell
25-
codefresh get pip"pipeline_name" -o yaml> pipeline_backup_file
28+
codefresh get pip"<pipeline_name>" -o yaml><pipeline_backup_file>
2629
```
27-
2830
{% endraw %}
2931

30-
If you would like to export protected variables, run the following:
32+
where:
33+
*`"<pipeline_name>"` is the name of the pipeline to back up.
34+
*`<pipeline_backup_file>` is the name of the file to which to save the backed up pipeline.
35+
36+
37+
**Export protected variables**
3138

3239
{% raw %}
3340

@@ -37,7 +44,8 @@ codefresh get pip "pipeline_name" --decrypt-variables -o yaml > pipeline_backup
3744

3845
{% endraw %}
3946

40-
To recreate a pipeline from a backup file, run the following command:
47+
48+
**Recreate a pipeline from a backup file**
4149

4250
{% raw %}
4351

@@ -47,6 +55,4 @@ codefresh replace -f pipeline_backup_file
4755

4856
{% endraw %}
4957

50-
##Related Items
5158

52-
[Codefresh CLI](https://codefresh-io.github.io/cli/installation/)

‎_docs/kb/articles/clone-target-instead-of-branch-on-pr.md‎

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title:"How To: Clone target instead of source branchon pull request"
2+
title:"How To: Clone target instead of source branchfor pull request"
33
description:
44
group:kb
55
sub-group:articles
@@ -11,19 +11,24 @@ categories: [Pipelines]
1111
support-reviewed:2023-04-18 LG
1212
---
1313

14-
##Overview
14+
This article describes how to clone the target instead of the source branch in a PR (pull request)-triggered build.
1515

16-
In most cases,buildswilluse thevariable`CF_BRANCH` to referencethebranchassociated with agit triggered build.
16+
Typically, pipelinebuilds use the`CF_BRANCH`variableto referencethe branchassociated with abuild triggeredby a Git event. However, in the case of abuild triggered by a PR,`CF_BRANCH` specifically references the source branch. To clone the_target branch_ instead of the_source branch_ during a merge, use the`CF_PULL_REQUEST_TARGET` variable, which specifically points to the target branch.
1717

18-
In a pull request triggered build,`CF_BRANCH` specifically refers to the
19-
source branch, and another variable`CF_PULL_REQUEST_TARGET` refers to the
20-
target branch. You may need to use the target branch instead in your merge
21-
build.
2218

23-
##Details
2419

25-
* Create a separate pipeline that uses {% raw %}`${{CF_PULL_REQUEST_TARGET}}`{% endraw %} instead of the standard {% raw %}`${{CF_BRANCH}}`{% endraw %} or
26-
* Add the following step before your clone step to check if`CF_PULL_REQUEST_TARGET` exists, and if it does assign its value to`CF_BRANCH`:
20+
##How to
21+
22+
>**NOTE**
23+
`CF_BRANCH` is available only for PR-triggered builds. Updating its value to match`CF_PULL_REQUEST_TARGET` clones the target branch instead.
24+
If`CF_PULL_REQUEST_TARGET` is not present, the build defaults to cloning the source branch.
25+
26+
<!--- >>💡 The ability to override predefined variables such as `CF_BRANCH` was added recently and may be disabled for your account. If the approach described in this article does not work in your account, please [contact support](https://support.codefresh.io/hc/en-us/requests/new).-->
27+
28+
* Create a separate pipeline that uses {% raw %}`${{CF_PULL_REQUEST_TARGET}}`{% endraw %} instead of the standard {% raw %}`${{CF_BRANCH}}`{% endraw %}
29+
OR
30+
* Add the following step before your`git-clone` step to check if`CF_PULL_REQUEST_TARGET` exists.
31+
If it does, to assign its value to`CF_BRANCH`:
2732

2833
{% raw %}
2934

@@ -44,8 +49,4 @@ build.
4449
4550
{% endraw %}
4651
47-
>_Note:_
48-
>
49-
>`CF_BRANCH` is the source branch in a PR-initiated build. By updating its value to the value of `CF_PULL_REQUEST_TARGET` the target will be pulled instead. This variable only exists for PR triggered builds, and if not present the build will clone the source branch instead.
5052
51-
>💡 The ability to override predefined variables such as `CF_BRANCH` was added recently and may be disabled for your account. If the approach described in this article does not work in your account, please [contact support](https://support.codefresh.io/hc/en-us/requests/new).

‎_docs/kb/articles/debug-mode-cli.md‎

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,42 @@ categories: [Pipelines, CLI]
1111
support-reviewed:2023-04-18 LG
1212
---
1313

14-
##Overview
14+
This article describes how to enable debug mode when using the Codefresh CLI for pipeline management.
15+
Enabling the`debug` mode provides detailed output helping you to understand the reasons for potential issues.
1516

16-
When you're running commands using Codefresh CLI you may face some issues related to:
17+
Debig mode is useful when facing issues related to:
18+
* Authentication
19+
* Network access, such as connectivity to the Codefresh platform
20+
* Delays or errors during command execution, as when running a pipeline locally
1721

18-
* Authentication problems
19-
* Network-related issues (e.g.: trying to reach Codefresh platform)
20-
* Delays or errors executing a command (e.g.: running a pipeline locally)
22+
>**NOTE**
23+
Make sure you have the[latest version of the CLI](https://codefresh-io.github.io/cli/installation/){:target="\_blank"}.
2124

22-
By enabling the`debug` mode when using the Codefresh CLI, you will get more verbose output, which will help you to understand where and when a potential issue is happening.
25+
##How to
2326

24-
##Details
25-
26-
1. Enable the`debug` mode for the Codefresh CLI: to do so, you need to initialize the`DEBUG` environment variable as follows:
27+
1. Initialize the`DEBUG` environment variable:
2728

2829
```shell
2930
DEBUG=codefresh*
3031
```
3132

32-
2. Run the Codefresh CLIcommand you would like to debug. For example:
33+
1. Run the Codefresh CLIcommand you want to debug.
34+
For example:
3335

3436
```shell
3537
codefresh run my-project/my-pipeline --local
3638
```
3739

38-
(or any other Codefresh CLI command)
39-
40-
3. You will get an output similar to this:
40+
1. Analyze the output to identify issues.
41+
Below is an example of CLIcommand outputin debug mode.
4142

4243
![Codefresh CLI debug output]({{site.baseurl}}/images/troubleshooting/cli-debug-mode.png)
4344

44-
>**_Note:_**
45-
>
46-
>If after reviewing the output provided by the debug mode you're still unable to fix the issue, please include that output in a ticket. That way the Support Team will be able to help you.
45+
{{site.data.callout.callout_tip}}
46+
**TIP**
47+
If after analyzing the debug output you're unable to resolve the issue, please submit a ticket to Codefresh Support, including the output details.
48+
{{site.data.callout.end}}
4749
48-
## Related Items
50+
## Related articles
51+
[Codefresh CLI documentation](https://codefresh-io.github.io/cli/)
4952
50-
* [Codefresh CLI documentation](https://codefresh-io.github.io/cli/)
51-
* [Codefresh CLI Installation and upgrade process](https://codefresh-io.github.io/cli/installation/) (it's important to keep your Codefresh CLI up to date)

‎_docs/kb/articles/disable-status-updates-to-github.md‎

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,23 @@ categories: [Pipelines, CLI, Settings]
1111
support-reviewed:2023-04-18 LG
1212
---
1313

14-
##Overview
1514

16-
You need to option to stop status update to github from a pipeline
1715

18-
##Details
16+
This article describes how to stop status update from a pipeline to GitHub.
1917

20-
To disable status updates to Github, please follow these steps (it's currently supported only via CLI):
18+
>**NOTE**
19+
Disabling status updates to GitHub is currently supported only via CLI for Codefresh pipelines.
2120

22-
1. Install the Codefresh CLI:<https://codefresh-io.github.io/cli/installation/>
21+
##Before you begin
2322

24-
2. Authenticate the CLI to your Codefresh account:<https://codefresh-io.github.io/cli/authentication/>
23+
* Install the CLI](https://codefresh-io.github.io/cli/installation/){:target="\_blank"}
24+
*[Authenticate the CLI to your Codefresh account](https://codefresh-io.github.io/cli/authentication/){:target="\_blank"}
2525

26-
3. Run`codefresh get pipeline <project_name/pipeline_name> -o yaml > pipeline_name_spec.yaml` to export the full pipeline spec as a YAML file
26+
##How to
2727

28-
4. Add the options section under`spec`, set`enableNotifications: false` and save the changes. The updated YAML should look like this:
28+
1. Export the full pipeline spec as a YAML file:
29+
`codefresh get pipeline <project_name/pipeline_name> -o yaml > pipeline_name_spec.yaml` to
30+
1. Below`spec`, add`options` and then add`enableNotifications: false`, as in the example below.
2931

3032
```yaml
3133
version:'1.0'
@@ -35,5 +37,5 @@ To disable status updates to Github, please follow these steps (it's currently s
3537
options:
3638
enableNotifications:false
3739
```
38-
39-
5. Run the`codefresh replace pipeline -f pipeline_name_spec.yaml` to update your pipeline from the YAML file
40+
1. Save the changes and close the YAML.
41+
5. Run the`codefresh replace pipeline -f pipeline_name_spec.yaml` to update your pipelinewith the specificationsfrom the YAML file.

‎_docs/kb/articles/ensure-cleanup-when-pipelines-stops.md‎

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title:"How To:Ensure Clean Up CommandsAlwaysRun If a Pipeline Is Manually Stopped"
2+
title:"How To: Alwaysrun clean-up commands after pipeline execution"
33
description:
44
group:kb
55
sub-group:articles
@@ -11,13 +11,21 @@ categories: [Pipelines]
1111
support-reviewed:2023-05-04 LG
1212
---
1313

14-
##Overview
1514

16-
Sometimes you might want to run code at the end of every pipeline (eg to clean up resources) regardless of success, failure, or the pipeline is manually stopped.
1715

18-
##Details
16+
This article describes how to insert a parallel step within a sequential pipeline to run specific commands at the end of pipeline execution. A common use case for this approach is automating resource cleanup tasks.
1917

20-
When working with a sequential (default) pipeline, you will find that manually stopping a pipeline halts the entire pipeline - including any pipeline hooks set to run on_success or on_failure[1]. However, if you switch the entire pipeline work in parallel[2], you can use the below step as a template to ensure that your clean up code will always run:
18+
The parallel step always runs at the end of the pipeline, regardless of its build status, or if the pipeline was manually terminated.
19+
20+
21+
22+
##How to
23+
24+
In a sequential pipeline, which is the default execution mode for pipelines, manually terminating the pipeline, also terminates the execution of subsequent steps, including any pipeline hooks set to run on success or failure.
25+
26+
You can circumvent this behavior by inserting a parallel step within the pipeline.
27+
28+
* Add the step below as a template to ensure code clean-up will always run:
2129

2230
```yaml
2331
cleaner_always_executed:
@@ -32,8 +40,6 @@ cleaner_always_executed:
3240
buildSuccess:workflow.result == 'success'
3341
```
3442
35-
## Related Items
36-
37-
[1] <https://codefresh.io/docs/docs/pipelines/hooks/>
38-
39-
[2] <https://codefresh.io/docs/docs/pipelines/advanced-workflows/#parallel-pipeline-mode>
43+
## Related articles
44+
[Hooks in pipelines]({{site.baseurl}}/docs/pipelines/hooks/)
45+
[Parallel pipeline execution]({{site.baseurl}}/docs/pipelines/advanced-workflows/#parallel-pipeline-execution)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp