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/variables.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,8 +8,8 @@ toc: true
8
8
---
9
9
Codefresh provides a set of predefined variables automatically in each build, that you can use to parameterize the way your pipeline works. You can also define your own variables. Some common examples of predefined variables include:
10
10
11
-
*`CF_BRANCH` is thegit branch that was used for this pipeline.
12
-
*`CF_REVISION` is thegit hash that was used for this pipeline.
11
+
*`CF_BRANCH` is theGit branch that was used for this pipeline.
12
+
*`CF_REVISION` is theGit hash that was used for this pipeline.
13
13
*`CF_BUILD_URL` is the url of the pipeline build.
14
14
15
15
##Using Codefresh variables in your pipelines
@@ -81,7 +81,7 @@ Notice that this syntax is specific to Codefresh and is **only** available withi
81
81
82
82
All system provided variables will also be automatically injected to any freestyle step as environment variables.
83
83
84
-
>It is important to understand that all Git related variables such`CF_BRANCH`,`CF_COMMIT_MESSAGE`,`CF_REVISION` etc. are coming directly from theGIT provider you use and have the same limitations of that provider. For example GitLab is sending less information in pull request events than normal pushes, and Bitbucket sends only the short hash of a commit in pull request events. We suggest you read the documentation of yourgit provider first to understand what information is available for everygit event
84
+
>It is important to understand that all Git related variables such`CF_BRANCH`,`CF_COMMIT_MESSAGE`,`CF_REVISION` etc. are coming directly from theGit provider you use and have the same limitations of that provider. For example GitLab is sending less information in pull request events than normal pushes, and Bitbucket sends only the short hash of a commit in pull request events. We suggest you read the documentation of yourGit provider first to understand what information is available for everyGit event
85
85
86
86
{: .table .table-bordered .table-hover}
87
87
| Variable| Description|
@@ -99,8 +99,9 @@ All system provided variables will also be automatically injected to any freesty
99
99
| {% raw %}`${{CF_BUILD_INITIATOR}}`{% endraw %}| The person (username) that started the build. If the build was started by a Git webhook (e.g. from a Pull request) it will hold the webhook user. Notice that if a build is restarted manually it will always hold the username of the person that restarted it.|
100
100
| {% raw %}`${{CF_ACCOUNT}}`{% endraw %}| Codefresh account for this build|
101
101
| {% raw %}`${{CF_COMMIT_URL}}`{% endraw %}| Commit url.|
102
-
| {% raw %}`${{CF_COMMIT_MESSAGE}}`{% endraw %}| Commit message of the git repository revision, at the time of execution.<br/> The messages quotes are escaped (i.e. ' is not\', " is now\").|
103
-
| {% raw %}`${{CF_REVISION}}`{% endraw %}| Revision of the Git repository of the main pipeline, at the time of execution. <br/> You can also use {% raw %}`${{CF_SHORT_REVISION}}`{% endraw %} to get the abbreviated 7-character revision hash, as used in git. Note: use this variable as string with quotes to tag the image {% raw %}`${{CF_SHORT_REVISION}}`{% endraw %}|
102
+
| {% raw %}`${{CF_COMMIT_MESSAGE}}`{% endraw %}| Commit message of the Git repository revision, at the time of execution.<br/> The messages quotes are escaped (i.e. ' is not\', " is now\").|
103
+
| {% raw %}`${{CF_COMMIT_MESSAGE_ESCAPED}}`{% endraw %}| Commit message of the Git repository revision, at the time of execution.<br/> Special characters are escaped.|
104
+
| {% raw %}`${{CF_REVISION}}`{% endraw %}| Revision of the Git repository of the main pipeline, at the time of execution. <br/> You can also use {% raw %}`${{CF_SHORT_REVISION}}`{% endraw %} to get the abbreviated 7-character revision hash, as used in Git. Note: use this variable as string with quotes to tag the image {% raw %}`${{CF_SHORT_REVISION}}`{% endraw %}|
104
105
| {% raw %}`${{CF_VOLUME_NAME}}`{% endraw %}| Refers to the[shared volume]({{site.baseurl}}/docs/configure-ci-cd-pipeline/introduction-to-codefresh-pipelines/#sharing-the-workspace-between-build-steps) between[freestyle steps]({{site.baseurl}}/docs/codefresh-yaml/steps/freestyle/). Normally you only need to define this in[compositions]({{site.baseurl}}/docs/codefresh-yaml/steps/composition/). In freestyle steps, it is automatically present without any extra configuration.|
105
106
| {% raw %}`${{CF_VOLUME_PATH}}`{% endraw %}| Refers to the mounted path of the[shared volume]({{site.baseurl}}/docs/configure-ci-cd-pipeline/introduction-to-codefresh-pipelines/#sharing-the-workspace-between-build-steps) inside a Freestyle container. In the current implementation it expands to`/codefresh/volume`.|
106
107
| {% raw %}`${{CF_BUILD_TRIGGER}}`{% endraw %}| Will be an indication of the current build was triggered:*build: The build was triggered from the build button* webhook: The build was triggered from a control version webhook|
@@ -170,7 +171,7 @@ Variables that are created by steps can have members. The members depend on the
170
171
171
172
##GitHub Release Variables
172
173
173
-
GitHub allows you to create[releases](https://help.github.com/articles/creating-releases/) for marking specificgit tags for general availability.
174
+
GitHub allows you to create[releases](https://help.github.com/articles/creating-releases/) for marking specificGit tags for general availability.
174
175
175
176
You can set a[trigger]({{site.baseurl}}/docs/configure-ci-cd-pipeline/triggers/git-triggers/) for GitHub releases. When a GitHub release happens, the following variables are also available: