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

Commitaff9b78

Browse files
committed
intial article migration
1 parent2fbe5f4 commitaff9b78

File tree

138 files changed

+6479
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+6479
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#403 Forbidden Error On Codefresh CLI Commands Within Build
2+
3+
#
4+
5+
##Overview
6+
7+
When running a Codefresh CLI command from within a build, it fails with a 403
8+
forbidden error.
9+
10+
##Details
11+
12+
Builds are run with the user context of the user who started it. So if any
13+
Codefresh CLI commands within a build fails with a 403 error, that means the
14+
user who started the build does not have the permissions to run this command.
15+
16+
1. Make sure this user is intended to have permissions to the actions performed by these CLI commands.
17+
2. As an account admin, make modifications to this user's team assignment and/or your account's permissions rules to grant this user access on relevant objects and actions.
18+
19+
##Related Items
20+
21+
[Codefresh Access
22+
Control](https://codefresh.io/docs/docs/administration/access-control/)
23+
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#About reuseVolumeSelector options
2+
3+
#
4+
5+
##Overview
6+
7+
The behavior of how the volumes are reused depends on volume selector
8+
configuration.
9+
10+
`reuseVolumeSelector: 'codefresh-app,io.codefresh.accountName'`
11+
12+
That means that a determined volume can be used by any pipeline of your
13+
account.
14+
15+
`reuseVolumeSelector: 'codefresh-app,io.codefresh.accountName,pipeline_id'`
16+
17+
That means that a determined PV can be used only by a specific pipeline.
18+
19+
##Details
20+
21+
For approach_codefresh-app,io.codefresh.accountName_ :
22+
23+
* Benefit: less PVs --> lower cost (since any PV can be used by any pipeline, then, the cluster would need to keep less PVs in its pool of PVs for Codefresh)
24+
* Downside: since the PV can be used by any pipeline, then, the PVs could have assets and info from different pipelines, thus reducing the probability of cache,
25+
26+
For approach_codefresh-app,io.codefresh.accountName,pipeline_id_ :
27+
28+
* Benefit: more probability of cache (no "spam" from other pipelines)
29+
* Downside: more PVs to keep (higher cost)
30+
31+
###How-to change the reuseVolumeSelector in your Runtime Environment
32+
33+
To make the changes in your Runtime Environment, you will need to use the
34+
[Codefresh CLI.](https://codefresh-io.github.io/cli/installation/)
35+
36+
1\. Get your Runtime Environment:
37+
38+
`codefresh get re <name> -o yaml > spec.yaml`
39+
40+
2\. Modify the reuseVolumeSelector in the the downloaded file, in the example
41+
below we change it to per-pipeline mode:
42+
43+
44+
45+
...
46+
pvcs:
47+
dind:
48+
...
49+
reuseVolumeSelector: 'codefresh-app,io.codefresh.accountName, **pipeline_id** '
50+
...
51+
52+
3\. Patch your RE using the following CLI command:
53+
54+
`codefresh patch re -f spec.yaml`
55+
56+
##Related items
57+
58+
[Volume Reusage
59+
Policy](https://codefresh.io/docs/docs/administration/codefresh-
60+
runner/#volume-reusage-policy)
61+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#Attempting to clone from a repo but access is denied
2+
3+
#
4+
5+
##Overview
6+
7+
Access is denied when using a clone step
8+
9+
##Details
10+
11+
Insufficient access in the Git integration, or incorrect Git integration
12+
used.:
13+
14+
* Ensure that the account used in Integrations has the appropriate access.
15+
* Ensure that in your clone step, you are using the right name for the git provider.
16+
* If the account used to set up integration is no longer active, you will need to remove the current integration and replace it.
17+
1. Go to your[Account Settings -> Integrations -> Git](https://g.codefresh.io/account-admin/account-conf/integration/git).
18+
19+
* If you do not have access, please contact one of your team's admins
20+
2. Update the previous integration with a new token, or delete the previous integration
21+
3. Create a new integration
22+
23+
_Notes_
24+
25+
When deleting a git integration, you may get an error saying the integration
26+
cannot be deleted while other objects are using it. This means an existing
27+
pipeline is referencing the integration. Please refer to[How-to: Update
28+
Trigger Git Context](https://support.codefresh.io/hc/en-
29+
us/articles/360020967860) on how to find and modify these existing references.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#Account invitation not permitting login
2+
3+
#
4+
5+
##Overview
6+
7+
1. Accepting an invite does not allow you to access the inviting account.
8+
2. Accepting an invite does not work, and fails to let you log in.
9+
10+
##Details
11+
12+
The account is not correctly linked.
13+
14+
1. Ensure that the email account you're logging in with is the same as the email address used for the invite.
15+
2. Log out of any previous sessions with the relevant identity provider and if need be, try a different browser or a private/incognito window.
16+
3. If you are able to log in but don't see the inviting account, your user may be under multiple accounts. If this is the case, you can switch between available accounts via the user menu drop-down in the upper right-hand corner.
17+
18+
_Notes_ In the event that this issue persists, please[contact our support
19+
team](https://support.codefresh.io/hc/en-us/requests/new) with as many details
20+
as you have.
21+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#How To: Acquire webhook information after a git trigger has been created
2+
3+
#
4+
5+
##Overview
6+
7+
Currently, there is no way to gather this information via the Codefresh Web
8+
Interface. This information can be acquired via the CLI / API call to get the
9+
pipeline spec.
10+
11+
##Details
12+
13+
1.`codefresh get pipeline Project/Pipeline -o yaml`
14+
2. Under spec.triggers you can see the information about each git trigger.
15+
3. Information you will need is the**endpoint** and**secret** fields
16+
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#How-to: Add a direct link to the Parent build from a Child build
2+
3+
#
4+
5+
##Overview
6+
7+
The Parent-Child approach is a common pattern when defining your CI/CD
8+
processes. It's possible to implement that model in Codefresh when using the
9+
`codefresh-run` plugin ([link](https://codefresh.io/steps/step/codefresh-
10+
run)).
11+
12+
Given the popularity of this pattern, it's also common having to navigate from
13+
the Parent-build to its Child-build. This functionality is natively provided
14+
by the platform.
15+
16+
But, currently, it's not possible to easily navigate from the Child-build to
17+
its parent.
18+
19+
In this article we'll provide a solution for that scenario.
20+
21+
##Details
22+
23+
Every build that is executed by a call to a`codefresh-run` plugin is enriched
24+
with a special annotation that precisely identifies its parent.
25+
26+
The name of this annotation is`cf_predecessor`. We can query the value of
27+
this annotation in the Child-build, and using that information we can know its
28+
parent. Specifically, it's possible to get the ID of the Parent-build.
29+
30+
With that information, it's also possible to build a link to the Parent-build
31+
by constructing the corresponding build-URL.
32+
33+
###Implementation
34+
35+
Since all the information can be inferred from the Child-build itself, there's
36+
nothing to add or modify in the Parent-build.
37+
38+
You'll need to simply add this step to the Child-build. For example, at the
39+
beginning of the pipeline:
40+
41+
42+
43+
steps:
44+
...
45+
linkToParentBuild:
46+
image: codefresh/cli
47+
commands:
48+
- export parentBuildId=$(codefresh get annotation build ${{CF_BUILD_ID}} cf_predecessor -o json | jq -r '.value')
49+
- cf_export linkToParentBuild_CF_OUTPUT_URL="${{CF_URL}}/build/${parentBuildId}"
50+
...
51+
52+
53+
![Link to Parent-
54+
build](https://support.codefresh.io/hc/article_attachments/360024616939/how-
55+
to-navigate-to-parent-build-from-child-build.png)
56+
57+
>Note:
58+
>
59+
>For the in-step-link to work, the name of the`cf_export`ed variable must
60+
>follow this pattern:`<name|key_of_step>_CF_OUTPUT_URL`, and its value
61+
>should be the URL to link to.
62+
63+
##Related Items
64+
65+
*[Codefresh Run plugin](https://codefresh.io/steps/step/codefresh-run)
66+
*[Annotations in Codefresh](https://codefresh.io/docs/docs/codefresh-yaml/annotations/)
67+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#How-to: Add Public ECR registry integration
2+
3+
#
4+
5+
##Overview
6+
7+
You want to add a Public ECR integration in your Codefresh account.
8+
9+
##Details
10+
11+
You can use**Other Registries** option in the Docker integration page to add
12+
a Public ECR integration.
13+
14+
You will need to pass username and password to create the integration. You can
15+
get these values from the AWS console:
16+
17+
* Navigate to "Amazon ECR/Repositories/Public/<repo>" and click the "View push commands" button at the upper right, in the next window note the first command that will print out the password.
18+
19+
![](/attachments/token/ZgWLZOUmiEUk0ZwienyjQOmAd/?name=Selection_656.png)
20+
21+
In the Codefresh[integration page](https://g.codefresh.io/account-
22+
admin/account-conf/integration/registryNew) select 'Add Registry Provider >
23+
Other Registries', enter any Registry name, put "AWS" in the Username field,
24+
then run the following command
25+
26+
`aws ecr-public get-login-password --region us-east-1`
27+
28+
and put the output in the Password field, fill in the prefix field in advanced
29+
options too.
30+
31+
![](/attachments/token/ffh8A8TMJeEqyo17x5kHD2ZY6/?name=Selection_657.png)
32+
33+
Test the connection if needed and save the changes.
34+
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#How-to: Adding a new AWS EKS cluster to Codefresh programmatically
2+
3+
#
4+
5+
##Overview
6+
7+
As part of your pipeline, you create a new cluster and want to add it to
8+
Codefresh
9+
10+
##Details
11+
12+
1. Note the name of the cluster in a variable, such as`$K8S_NAME`.
13+
2. After the cluster is created, run the following API call, replacing all with your values or variables:
14+
15+
16+
17+
add_new_cluster:
18+
image: <your-image>
19+
commands:
20+
- curl -s --fail\
21+
-H "Authorization: <CF_API_KEY>"\
22+
-H "content-type: application/json;charset=UTF-8"\
23+
-d\
24+
"{
25+
\"type\":\"sat\",
26+
\"selector\":\"<K8S_NAME>\",
27+
\"host\":\"<K8S_HOST>\",
28+
\"clientCa\":\"<K8S_CA>\",
29+
\"serviceAccountToken\":\<$K8S_TOKEN\>,
30+
\"provider\":\"local\",
31+
\"providerAgent\":\"eks\"
32+
}"\
33+
"$CF_API_HOST/api/clusters/local/cluster"
34+
35+
36+
_**Note** :_ A more detailed[EKS workflow can be found
37+
here](https://github.com/codefresh-io/eks-installer).
38+
39+
##Related Items
40+
41+
[EKS Installer](https://github.com/codefresh-io/eks-installer)[API
42+
documentation - clusters](https://g.codefresh.io/api/#tag/Clusters)
43+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#Attaching volume to composition
2+
3+
#
4+
5+
##Overview
6+
7+
You are attempting to access the shared volume from a composition or service,
8+
but you are not able to.
9+
10+
##Details
11+
12+
You have not mounted the volume, or you have used incorrect syntax.
13+
14+
Mount the volume as part of your composition.
15+
16+
17+
18+
services:
19+
composition:
20+
mongodb:
21+
image: 'mongo:4.2'
22+
ports:
23+
- '27017:27017'
24+
volumes:
25+
- '${{CF_VOLUME_NAME}}:${{CF_VOLUME_PATH}}'
26+
27+
28+
_Notes_
29+
30+
`CF_VOLUME_PATH` refers to /codefresh/volume. You may use that, or any other
31+
directory, you wish.
32+
33+
##Related Items
34+
35+
[Codefresh Docs: Accessing your project folder from a
36+
composition](https://codefresh.io/docs/docs/codefresh-
37+
yaml/steps/composition/#accessing-your-project-folder-from-a-composition)
38+
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#Build terminated because of prolonged inactivity while testing a Node app
2+
with Jest
3+
4+
#
5+
6+
##Overview
7+
8+
Build terminated because of prolonged inactivity while running step with Jest
9+
tests.
10+
11+
##Details
12+
13+
When none of the steps produce logs for a long time (45 minutes by default),
14+
the build terminates as inactive. The most common reason for this when using
15+
Jest framework — unfinished async operations in your app.
16+
17+
Closer look to the test logs will show the following:
18+
19+
20+
21+
<...>
22+
Ran all test suites.
23+
**Jest did not exit one second after the test run has completed.**
24+
**This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue.**
25+
26+
Trying to terminate step execution
27+
<...>
28+
29+
Jest indicates that the process was not completed because some async
30+
operations are still running in your app even when tests are finished. The
31+
possible roots can be: unhandled promise rejections caused to hang sockets,
32+
opened connection to DB if not closed on tests finish, etc.
33+
34+
By default, Jest waits for any operations to be finished before exiting, which
35+
can hang the process for an unpredicted amount of time.
36+
37+
###Solution
38+
39+
**Quick workaround**
40+
41+
A quick workaround (which is not recommended for daily usage) would be to run
42+
tests with[`--forceExit` flag](https://jestjs.io/docs/cli#--forceexit), which
43+
says to Jest to ignore open handles and exit process as soon as tests are
44+
finished.
45+
46+
**Solution**
47+
48+
Please debug and fix the app locally with[`--detectOpenHandles`
49+
flag](https://jestjs.io/docs/cli#--detectopenhandles) to find out which
50+
operations keeps Jest from exiting.
51+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp