This repository has been archived by the owner on Nov 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #259 from mkosiarc/custom-tags
Add documentation for using custom additional tags
- Loading branch information
Showing
2 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
docs/modules/ROOT/pages/how-to-guides/configuring-builds/proc_custom-tags.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
:_content-type: PROCEDURE | ||
:troubleshooting_builds: | ||
|
||
[id="custom-tags_{context}"] | ||
= Using custom tags | ||
|
||
Konflux allows tagging built images with custom tags. This tagging is handled by separate *apply-tags* task. The custom tags can be configured in two ways: | ||
|
||
. <<using-konflux-label>> | ||
. <<using-additional-tags-parameter>> | ||
|
||
[NOTE] | ||
==== | ||
These can be combined and used together | ||
==== | ||
|
||
[[using-konflux-label]] | ||
== Using konflux.additional-tags image label in your Dockerfile | ||
|
||
You can specify the additional custom tags directly in your Dockerfile by using the *konflux.additional-tags* label, e.g.: | ||
|
||
---- | ||
LABEL konflux.additional-tags="tag1" | ||
---- | ||
|
||
If you want to specify multiple tags, they have to be separated by space or a comma, e.g.: | ||
|
||
---- | ||
LABEL konflux.additional-tags="tag1 tag2" | ||
---- | ||
|
||
---- | ||
LABEL konflux.additional-tags="tag1, tag2" | ||
---- | ||
|
||
[[using-additional-tags-parameter]] | ||
== Using ADDITIONAL_TAGS parameter for apply-tags task. | ||
You can also specify additional custom tags by using *ADDITIONAL_TAGS* array parameter for apply-tags task in your PipelineRun definition, e.g: | ||
|
||
---- | ||
... | ||
- name: apply-tags | ||
params: | ||
- name: IMAGE | ||
value: $(tasks.build-container.results.IMAGE_URL) | ||
- name: ADDITIONAL_TAGS | ||
value: ["tag1", "tag2"] | ||
runAfter: | ||
- build-container | ||
... | ||
---- | ||
|
||
The array parameter ADDITIONAL_TAGS can also be specified differently: | ||
|
||
---- | ||
... | ||
- name: apply-tags | ||
params: | ||
- name: IMAGE | ||
value: $(tasks.build-container.results.IMAGE_URL) | ||
- name: ADDITIONAL_TAGS | ||
value: | ||
- tag1 | ||
- tag2 | ||
runAfter: | ||
- build-container | ||
... | ||
---- | ||
|
||
[NOTE] | ||
==== | ||
The provided tags can also be based on dynamic variables that are provided by Pipelines as Code, e.g.: | ||
---- | ||
... | ||
- name: apply-tags | ||
params: | ||
- name: IMAGE | ||
value: $(tasks.build-container.results.IMAGE_URL) | ||
- name: ADDITIONAL_TAGS | ||
value: ["pull-request-{{pull_request_number}}", "from-branch-{{source_branch}}", "{{target_branch}}"] | ||
runAfter: | ||
- build-container | ||
... | ||
---- | ||
To see all available dynamic variables, please see the dynamic variables section in the https://pipelinesascode.com/docs/guide/authoringprs/#dynamic-variables[Pipeline as Code documentation] | ||
==== |