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

Commit437c7b2

Browse files
authored
Cf integration examples (#257)
* Update with parameterization examplesAdded examples for CF_IMAGE, GIT_BRANCH* Updated examples for all ci integrations* Update examples for CI integrationsFormatting fixes
1 parent88c8a66 commit437c7b2

File tree

3 files changed

+271
-0
lines changed

3 files changed

+271
-0
lines changed

‎_docs/integrations/ci-integrations/codefresh-classic.md‎

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ toc: true
88

99
Use Hosted GitOps with any popular Continuous Integration (CI) solution, not just with Codefresh CI. Codefresh Classic is one of the third-party CI platform/tools that you can connect to Codefresh for deployment with image enrichment and reporting.
1010

11+
12+
1113
For information on how to use the image reporting action in your Codefresh Classic pipeline and how to configure the integration, see[CI Integrations]({{site.baseurl}}/docs/integrations/ci-integrations/).
1214

1315

@@ -37,6 +39,108 @@ The table describes the arguments required to connect Codefresh Classic to Codef
3739

3840
For how-to instructions, see[Connect a third-party CI platform/tool to Codefresh]({{site.baseurl}}/docs/integrations/ci-integrations/#connect-a-third-party-ci-platformtool-to-codefresh/).
3941

42+
###Templatization examples for CF arguments
43+
44+
Arguments such as`CF_IMAGE`,`CF_GIT_BRANCH`, and`CF_JIRA_MESSAGE` are populated dynamically when the Codefresh Classic integration pipeline is triggered. You can templatize the values of these arguments to ensure that the required information is included in the reported image.
45+
46+
Codefresh Classic offers[system variables](https://codefresh.io/docs/docs/codefresh-yaml/variables/#system-provided-variables) you can use to templatize argument values.
47+
48+
{::nomarkdown}
49+
<br>
50+
{:/}
51+
52+
####CF_IMAGE examples
53+
**Example: Report full repo and branch information**
54+
This example illustrates how to define the value for`CF_IMAGE` to report the repo owner, name, and branch, with the Git hash.
55+
56+
Value:
57+
{% raw %}`${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}:${{CF_BRANCH_TAG_NORMALIZED}}-${{CF_SHORT_REVISION}}`{% endraw %}
58+
59+
where:
60+
* {% raw %}`${{CF_REPO_OWNER}}`{% endraw %} reports the owner of the repository. For example,`nr-codefresh`.
61+
* {% raw %}`${{CF_REPO_NAME}}`{% endraw %} reports the name of the repository. For example,`codefresh-production`.
62+
* {% raw %}`${{CF_BRANCH_TAG_NORMALIZED}}`{% endraw %} reports the normalized version of the branch name, without invalid characters in case the branch name is the Docker image tag name. For example,`pr-2345`,`new-auth-strategy` (branch names without normalization required), and`gcr.io/codefresh-inc/codefresh-io/argo-platform-audit.1.1909.0` (normalized version of original branch name`gcr.io/codefresh-inc/codefresh-io/argo-platform-audit:1.1909.0`).
63+
* {% raw %}`${{CF_SHORT_REVISION}}`{% endraw %} reports the abbreviated 7-character revision hash, as used in Git. For example,`40659e7`.
64+
65+
**Example: Report a specific image tag**
66+
This example illustrates how to define the value for`CF_IMAGE` value when you know the specific image version you want to report.
67+
68+
Value:
69+
{% raw %}`{{CF_REPO_OWNER}}/${{CF_REPO_NAME}}:<v1.0>` {% endraw %}
70+
71+
where:
72+
* {% raw %}`${{CF_REPO_OWNER}}`{% endraw %} and {% raw %}`${{CF_REPO_NAME}}`{% endraw %} report the names of the repository owner and the repository, respectively. For example,`nr-codefresh` and`codefresh-production`, respectively.
73+
* {% raw %}`<v1.0>`{% endraw %} reports the hard-coded tag`v1.0`.
74+
75+
**Example: Report the latest Git tag available on repository**
76+
This example illustrates how to define the value for`CF_IMAGE` value to report the latest Git tag on the repository.
77+
78+
Value:
79+
{% raw %}`codefresh/${{CF_REPO_NAME}}:latest`{% endraw %}
80+
81+
where:
82+
* {% raw %}`codefresh`{% endraw %} is the hard-coded owner of the image.
83+
* {% raw %}`${{CF_REPO_NAME}}`{% endraw %} reports the name of the repository that triggered the pipeline. For example,`codefresh-production`.
84+
* {% raw %}`latest`{% endraw %} reports the latest Git tag available for the repository defined by {% raw %}`${{CF_REPO_NAME}}`{% endraw %}. For example,`v1.0.4-14-g2414721`.
85+
86+
{::nomarkdown}
87+
<br>
88+
{:/}
89+
90+
####CF_GIT_BRANCH examples
91+
92+
**Example: Report Git branch or tag with committer and commit message**
93+
94+
This example illustrates how to report the name or tag of the Git branch with committer and commit message.
95+
96+
Value:
97+
{% raw %}`${{CF_REPO_NAME}}/${{CF_BRANCH}}:${{CF_COMMIT_AUTHOR}}/${{CF_COMMIT_MESSAGE}}`{% endraw %}
98+
99+
where:
100+
* {% raw %}`${{CF_REPO_NAME}}`{% endraw %} reports the name of the repository. For example,`codefresh-production`.
101+
* {% raw %}`${{CF_BRANCH}}`{% endraw %} reports the branch name or tag based on the JSON payload of the Git repository that triggered the pipeline. For example,`new-auth-strategy`.
102+
* {% raw %}`${{CF_COMMIT_AUTHOR}}`{% endraw %} reports the name of the user who made the commit. For example,`cf-support`.
103+
* {% raw %}`${{CF_COMMIT_MESSAGE}}`{% endraw %} reports the commit message of the repository. For example,`support oauth authentication for ci integrations`.
104+
105+
106+
**Example: Report normalized Git branch or tag with committer and commit message**
107+
108+
This example illustrates how to report the normalized name or tag of the Git branch with committer and commit message.
109+
Normalizing the branch name removes any invalid characters in the name if the branch name is also used as the Docker image tag name.
110+
111+
Value:
112+
113+
{% raw %}`${{CF_REPO_NAME}}/${{CF_BRANCH_TAG_NORMALIZED}}:${{CF_COMMIT_AUTHOR}}/${{CF_COMMIT_MESSAGE}}`{% endraw %}
114+
115+
where:
116+
* {% raw %}`${{CF_REPO_NAME}}`{% endraw %} reports the name of the repository. For example,`codefresh-production`.
117+
* {% raw %}`${{CF_BRANCH_TAG_NORMALIZED}}`{% endraw %} reports the normalized version of the branch name or tag based on the JSON payload of the Git repository that triggered the pipeline.
118+
* {% raw %}`${{CF_COMMIT_AUTHOR}}`{% endraw %} reports the name of the user who made the commit. For example,`nr-codefresh`.
119+
* {% raw %}`${{CF_COMMIT_MESSAGE}}`{% endraw %}reports the commit message of the repository. For example,`support oauth authentication for ci integrations`.
120+
121+
**Example: Report normalized Git branch or tag in lowercase with PR information**
122+
123+
This example illustrates how to report the normalized name or tag of the Git branch in lowercase, with PR (pull request) information.
124+
Normalizing the branch name removes any invalid characters in the name if the branch name is also used as the Docker image tag name.
125+
126+
Value:
127+
{% raw %}`${{CF_REPO_NAME}}/${{CF_BRANCH_TAG_NORMALIZED}}:${{CF_PULL_REQUEST_TARGET}}/${{CF_PULL_REQUEST_NUMBER}}`{% endraw %}
128+
129+
where:
130+
* {% raw %}`${{CF_REPO_NAME}}`{% endraw %} reports the name of the repository. For example,`production`.
131+
* {% raw %}`${{CF_BRANCH_TAG_NORMALIZED}}`{% endraw %} reports the normalized version of the branch name or tag based on the JSON payload of the Git repository that triggered the pipeline. For example,`pr-2345`,`new-auth-strategy` (branch names without normalization required), and`gcr.io/codefresh-inc/codefresh-io/argo-platform-audit.1.1909.0` (normalized version of original branch name`gcr.io/codefresh-inc/codefresh-io/argo-platform-audit:1.1909.0`).
132+
* {% raw %}`${{CF_PULL_REQUEST_TARGET}}`{% endraw %} reports the target branch of the PR. For example,`new-auth-strategy`.
133+
* {% raw %}`${{CF_PULL_REQUEST_NUMBER}}`{% endraw %} reports the number of the PR. For example,`#323`.
134+
135+
{::nomarkdown}
136+
<br>
137+
{:/}
138+
139+
####CF_JIRA_MESSAGE examples
140+
The Jira message represents an existing Jira issue, and must be a literal string.
141+
142+
Value:
143+
`CR-1246`
40144

41145
###Example of report image step in Codefresh Classic pipeline
42146

‎_docs/integrations/ci-integrations/github-actions.md‎

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,90 @@ max-width="50%"
4444

4545
For how-to instructions, see[Connect a third-party CI platform/tool to Codefresh]({{site.baseurl}}/docs/integrations/ci-integrations/#connect-a-third-party-ci-platformtool-to-codefresh).
4646

47+
###Templatization examples for CF arguments
48+
49+
Arguments such as`CF_IMAGE`,`CF_GIT_BRANCH`, and`CF_JIRA_MESSAGE` are populated dynamically when the GitHub Actions pipeline is triggered. You can templatize the values of these arguments to ensure that the required information is included in the reported image.
50+
51+
See GitHub Actions[environment variables](https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables) you can use to templatize argument values.
52+
53+
{::nomarkdown}
54+
<br>
55+
{:/}
56+
57+
####CF_IMAGE
58+
59+
**Example: Report full repo and branch information**
60+
This example illustrates how to define the value for`CF_IMAGE` to report the repo owner, name, and short branch, with the Git hash.
61+
62+
Value:
63+
{% raw %}`${{ github.repository }}/${{ github.ref_name }}/${{ github.sha }}`{% endraw %}
64+
65+
where:
66+
* {% raw %}`${{ github.repository }}`{% endraw %} reports the owner of the repository and the name of the repository. For example,`nr-codefresh/codefresh-production`.
67+
* {% raw %}`${{ github.ref_name }}`{% endraw %} reports the short reference to the branch that triggered the workflow. For example,`auth-feature-branch`.
68+
* {% raw %}`${{ github.sha }}`{% endraw %} reports the complete commit SHA that triggered the workflow. For example,`fa53bfa91df14c4c9f46e628a65ee21dd574490a`.
69+
70+
71+
72+
**Example: Report a specific image tag**
73+
This example illustrates how to define the value for`CF_IMAGE` when you know the specific image version you want to report.
74+
75+
Value:
76+
{% raw %}`${{ github.repository }}:<v1.0>`{% endraw %}
77+
78+
where:
79+
* {% raw %}`${{ github.repository }}`{% endraw %} reports the owner of the repository and the name of the repository. For example,`nr-codefresh/codefresh-production`.
80+
*`<v1.0>` reports the hard-coded tag`v1.0`.
81+
82+
83+
**Example: Report the latest Git tag available on repository**
84+
This example illustrates how to define the value for`CF_IMAGE` to report the latest Git tag on the repository.
85+
86+
Value:
87+
{% raw %}`codefresh/${{ github.repository }}/latest`{% endraw %}
88+
89+
where:
90+
* {% raw %}`codefresh`{% endraw %} is the hard-coded owner of the image.
91+
* {% raw %}`${{ github.repository }}`{% endraw %} reports the owner of the repository and the name of the repository. For example,`nr-codefresh/codefresh-production`.
92+
* {% raw %}`latest`{% endraw %} reports the latest Git tag available for the repository defined by {% raw %}`${{ github.repository }}`{% endraw %}. For example,`v1.0.4-14-g2414721`.
93+
94+
{::nomarkdown}
95+
<br>
96+
{:/}
97+
98+
####CF_GIT_BRANCH
99+
100+
**Example: Report fully-formed reference of the branch or tag**
101+
This example illustrates how to define the value for`CF_GIT_BRANCH` to report the fully-formed reference of the branch or tag that triggered the workflow run.
102+
For workflows triggered by push events, this is the branch or tag ref that was pushed.
103+
For workflows triggered by pull_requests, this is the pull request merge branch.
104+
105+
Value:
106+
{% raw %}`${{ github.ref }}`{% endraw %}
107+
108+
where:
109+
* {% raw %}`${{ github.ref }}`{% endraw %} is the reference to the branch or tag. For example,`refs/heads/auth-feature-branch` (branch), and`refs/pull/#843/merge` (pull request).
110+
111+
**Example: Report short reference name of the branch or tag**
112+
This example illustrates how to define the value for`CF_GIT_BRANCH` to report only the name of the branch or tag that triggered the workflow run.
113+
114+
115+
Value:
116+
{% raw %}`${{ github.ref-name }}`{% endraw %}
117+
118+
where:
119+
* {% raw %}`${{ github.ref-name }}`{% endraw %} is the name of the target branch or tag. For example,`auth-feature-branch`.
120+
121+
{::nomarkdown}
122+
<br>
123+
{:/}
124+
125+
####CF_JIRA_MESSAGE
126+
The Jira message represents an existing Jira issue, and must be a literal string.
127+
128+
Value:
129+
`CR-1246`
130+
47131
###GitHub Actions pipeline example
48132

49133
Here is an example pipeline that uses GitHub Actions to build a container image, and the Codefresh action to enrich and report the resulting image to Codefresh.

‎_docs/integrations/ci-integrations/jenkins.md‎

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,89 @@ The table describes the arguments to connect Codefresh Classic to Codefresh.
4040

4141
For how-to instructions, see[Connect a third-party CI platform/tool to Codefresh]({{site.baseurl}}/docs/integrations/ci-integrations/#connect-a-third-party-ci-platform-tool-to-codefresh).
4242

43+
###Templatization examples for CF arguments
44+
45+
Arguments such as`CF_IMAGE`,`CF_GIT_BRANCH`, and`CF_JIRA_MESSAGE` are populated dynamically when the Jenkins pipeline is triggered. You can templatize the values of these arguments in the pipeline to ensure that the required information is included in the reported image.
46+
47+
Jenkins offers a Git plugin with[environment variables](https://plugins.jenkins.io/git/#plugin-content-environment-variables){:target="\_blank"} you can use to templatize argument values.
48+
49+
{::nomarkdown}
50+
<br>
51+
{:/}
52+
53+
####CF_IMAGE
54+
**Example: Report repo, branch with Git hash**
55+
This example illustrates how to define the value for`CF_IMAGE` to report Git repo, branch, committer, and Git hash information.
56+
57+
Value:
58+
{% raw %}`${env.GIT_COMMITTER_NAME}/${env.GIT_URL}/${env.GIT_BRANCH}/${env.GIT_REVISION}`{% endraw %}
59+
60+
where:
61+
* {% raw %}`${env.GIT_COMMITTER_NAME}`{% endraw %} reports the name of the user who made the commit. For example,`nr-codefresh`.
62+
* {% raw %}`${env.GIT_URL}`{% endraw %} reports the name of the Git repository. For example,`codefresh-production`.
63+
* {% raw %}`${env.GIT_BRANCH}`{% endraw %} reports the name of the Git branch. For example,`pr-2345`,`new-auth-strategy`.
64+
* {% raw %}`${env.GIT_REVISION}`{% endraw %} reports the Git SHA1 commit ID pointing to the commit that was built. For example,`fa53bfa91df14c4c9f46e628a65ee21dd574490a`.
65+
66+
67+
**Example: Report a specific image tag**
68+
This example illustrates how to define the value for`CF_IMAGE` when you know the specific image version you want to report.
69+
70+
Value:
71+
{% raw %}`${env.GIT_COMMITTER_NAME}/${env.GIT_URL}/<v1.0>`{% endraw %}
72+
73+
where:
74+
* {% raw %}`${env.GIT_COMMITTER_NAME}`{% endraw %} and {% raw %}`${env.GIT_URL}`{% endraw %} report the names of the user hwo made the commit and the repository, respectively. For example,`nr-codefresh` and`codefresh-production`, respectively.
75+
* {% raw %}`<v1.0>`{% endraw %} reports the hard-coded tag`v1.0`.
76+
77+
78+
**Example: Report the latest Git tag available on repository**
79+
This example illustrates how to define the value for`CF_IMAGE` value to report the latest Git tag on the repository.
80+
81+
Value:
82+
{% raw %}`codefresh/${env.GIT_URL}/latest`{% endraw %}
83+
84+
where:
85+
* {% raw %}`codefresh`{% endraw %} is the hard-coded re
86+
* {% raw %}`${env.GIT_URL}`{% endraw %} reports the name of the repository that triggered the integration.
87+
* {% raw %}`latest`{% endraw %} reports the latest Git tag available for the repository defined by {% raw %}`${env.GIT_URL}`{% endraw %}. For example,`v1.0.4-14-g2414721`.
88+
89+
{::nomarkdown}
90+
<br>
91+
{:/}
92+
93+
####CF_GIT_BRANCH
94+
95+
**Example: Report the fully-formed Git branch**
96+
This example illustrates how to define the value for`CF_GIT_BRANCH` value to report the fully-formed Git branch.
97+
98+
Value:
99+
{% raw %}`${env.GIT_URL}/${env.GIT_BRANCH}`{% endraw %}
100+
101+
where:
102+
* {% raw %}`${env.GIT_URL}`{% endraw %} is the name of the repository that triggered the pipeline. For example,`codefresh-production`.
103+
* {% raw %}`${env.GIT_BRANCH}`{% endraw %} is the fully-formed name of the Git branch. For example,`origin/auth-feature-branch`.
104+
105+
106+
**Example: Report the local Git branch**
107+
This example illustrates how to define the value for`CF_GIT_BRANCH` value to report only the branch in the repository that triggerred the pipeline.
108+
109+
Value:
110+
{% raw %}`${env.GIT_URL}/${env.GIT_LOCAL_BRANCH}`{% endraw %}
111+
112+
where:
113+
* {% raw %}`${env.GIT_URL}`{% endraw %} is the name of the repository that triggered the piepline.
114+
* {% raw %}`${env.GIT_LOCAL_BRANCH}`{% endraw %} is the name of the Git branch. For example,`auth-feature-branch`.
115+
116+
{::nomarkdown}
117+
<br>
118+
{:/}
119+
120+
####CF_JIRA_MESSAGE
121+
The Jira message represents an existing Jira issue, and must be a literal string.
122+
123+
Value:
124+
`CR-1246`
125+
43126

44127
###Example of Jenkins pipeline with report image step
45128

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp