forked from eclipse-jkube/jkube
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add compatibility with SemVer versions (eclipse-jkube#2301)
Signed-off-by: Christian Mäder <christian.maeder@nxt.engineering>
- Loading branch information
1 parent
1ffc921
commit 693c162
Showing
5 changed files
with
235 additions
and
26 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
31 changes: 25 additions & 6 deletions
31
gradle-plugin/doc/src/main/asciidoc/inc/image/_naming.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 |
---|---|---|
@@ -1,23 +1,42 @@ | ||
[[image-name]] | ||
When specifying the image name in the configuration with the `name` field you can use several placeholders which are replaced during runtime by this plugin. In addition you can use regular Gradle properties which are resolved by Gradle itself. | ||
When specifying the image name in the configuration with the `<name>` field, then you can use several placeholders. | ||
These placeholders are replaced during the execution by this plugin. | ||
In addition, you can use regular Gradle properties. | ||
These properties are resolved by Gradle itself. | ||
|
||
.Image Names | ||
[cols="1,5"] | ||
|=== | ||
| Placeholder | Description | ||
|
||
| *%g* | ||
| The last part of the Gradle group name, sanitized so that it can be used as username on GitHub. Only the part after the last dot is used. E.g. for a group id `org.eclipse.jkube` this placeholder would insert `jkube` | ||
| The last part of the Gradle group name. | ||
The name gets sanitized, so that it can be used as username on GitHub. | ||
Only the part after the last dot is used. | ||
For example, given the group id `org.eclipse.jkube`, this placeholder would insert `jkube`. | ||
|
||
| *%a* | ||
| A sanitized version of the artefact id so that it can be used as part of an Docker image name. I.e. it is converted to all lower case (as required by Docker) | ||
| A sanitized version of the artefact id, so that it can be used as part of a Docker image name. | ||
This means primarily, that it is converted to all lower case (as required by Docker). | ||
|
||
| *%v* | ||
| The project version. | ||
| A sanitized version of the project version. Replaces `+` with `-` in `${project.version}` to comply with the Docker tag convention. | ||
(A different replacement symbol can be defined by setting the `jkube.image.tag.semver_plus_substitution` property.) | ||
For example, the version '1.2.3b' becomes the exact same Docker tag, '1.2.3b'. | ||
But '1.2.3+internal' becomes the `1.2.3-internal` Docker tag. | ||
|
||
| *%l* | ||
| If the project version ends with `-SNAPSHOT` then this placeholder is `latest`, otherwise its the full version (same as `%v`) | ||
| If the https://semver.org/spec/v2.0.0.html#spec-item-9[pre-release part] of the project version ends with `-SNAPSHOT`, then this placeholder resolves to `latest`. | ||
Otherwise, it's the same as `%v`. | ||
|
||
If the `${project.version}` contains a https://semver.org/spec/v2.0.0.html#spec-item-10[build metadata part] (i.e. everything after the `+`), then the `+` is substituted and the rest is appended. | ||
For example, the project version `1.2.3-SNAPSHOT+internal` becomes the `latest-internal` Docker tag. | ||
|
||
| *%t* | ||
| If the project version ends with `-SNAPSHOT` this placeholder resolves to `snapshot-<timestamp>` where timestamp has the date format `yyMMdd-HHmmss-SSSS` (eg `snapshot-`). This feature is especially useful during development in oder to avoid conflicts when images are to be updated which are still in use. You need to take care yourself of cleaning up old images afterwards, though. | ||
| If the project version ends with `-SNAPSHOT`, this placeholder resolves to `snapshot-<timestamp>` where timestamp has the date format `yyMMdd-HHmmss-SSSS` (eg `snapshot-`). | ||
This feature is especially useful during development in oder to avoid conflicts when images are to be updated which are still in use. | ||
You need to take care yourself of cleaning up old images afterwards, though. | ||
|
||
If the `${project.version}` contains a https://semver.org/spec/v2.0.0.html#spec-item-10[build metadata part] (i.e. everything after the `+`), then the `+` is substituted and the rest is appended. | ||
For example, the project version `1.2.3-SNAPSHOT+internal` becomes the `snapshot-221018-113000-0000-internal` Docker tag. | ||
|=== |
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
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
32 changes: 25 additions & 7 deletions
32
kubernetes-maven-plugin/doc/src/main/asciidoc/inc/image/_naming.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 |
---|---|---|
@@ -1,24 +1,42 @@ | ||
[[image-name]] | ||
When specifying the image name in the configuration with the `<name>` field you can use several placeholders which are replaced during runtime by this plugin. In addition you can use regular Maven properties which are resolved by Maven itself. | ||
When specifying the image name in the configuration with the `<name>` field, then you can use several placeholders. | ||
These placeholders are replaced during the execution by this plugin. | ||
In addition, you can use regular Maven properties. | ||
These properties are resolved by Maven itself. | ||
|
||
.Image Names | ||
[cols="1,5"] | ||
|=== | ||
| Placeholder | Description | ||
|
||
| *%g* | ||
| The last part of the Maven group name, sanitized so that it can be used as username on GitHub. Only the part after the last dot is used. E.g. for a group id `org.eclipse.jkube` this placeholder would insert `jkube` | ||
| The last part of the Maven group name. | ||
The name gets sanitized, so that it can be used as username on GitHub. | ||
Only the part after the last dot is used. | ||
For example, given the group id `org.eclipse.jkube`, this placeholder would insert `jkube`. | ||
|
||
| *%a* | ||
| A sanitized version of the artefact id so that it can be used as part of an Docker image name. I.e. it is converted to all lower case (as required by Docker) | ||
| A sanitized version of the artefact id, so that it can be used as part of a Docker image name. | ||
This means primarily, that it is converted to all lower case (as required by Docker). | ||
|
||
| *%v* | ||
| The project version. Synonym to `${project.version}` | ||
| A sanitized version of the project version. Replaces `+` with `-` in `${project.version}` to comply with the Docker tag convention. | ||
(A different replacement symbol can be defined by setting the `jkube.image.tag.semver_plus_substitution` property.) | ||
For example, the version '1.2.3b' becomes the exact same Docker tag, '1.2.3b'. | ||
But '1.2.3+internal' becomes the `1.2.3-internal` Docker tag. | ||
|
||
| *%l* | ||
| If the project version ends with `-SNAPSHOT` then this placeholder is `latest`, otherwise its the full version (same as `%v`) | ||
| If the https://semver.org/spec/v2.0.0.html#spec-item-9[pre-release part] of the project version ends with `-SNAPSHOT`, then this placeholder resolves to `latest`. | ||
Otherwise, it's the same as `%v`. | ||
|
||
If the `${project.version}` contains a https://semver.org/spec/v2.0.0.html#spec-item-10[build metadata part] (i.e. everything after the `+`), then the `+` is substituted and the rest is appended. | ||
For example, the project version `1.2.3-SNAPSHOT+internal` becomes the `latest-internal` Docker tag. | ||
|
||
| *%t* | ||
| If the project version ends with `-SNAPSHOT` this placeholder resolves to `snapshot-<timestamp>` where timestamp has the date format `yyMMdd-HHmmss-SSSS` (eg `snapshot-`). This feature is especially useful during development in oder to avoid conflicts when images are to be updated which are still in use. You need to take care yourself of cleaning up old images afterwards, though. | ||
|=== | ||
| If the project version ends with `-SNAPSHOT`, this placeholder resolves to `snapshot-<timestamp>` where timestamp has the date format `yyMMdd-HHmmss-SSSS` (eg `snapshot-`). | ||
This feature is especially useful during development in oder to avoid conflicts when images are to be updated which are still in use. | ||
You need to take care yourself of cleaning up old images afterwards, though. | ||
|
||
If the `${project.version}` contains a https://semver.org/spec/v2.0.0.html#spec-item-10[build metadata part] (i.e. everything after the `+`), then the `+` is substituted and the rest is appended. | ||
For example, the project version `1.2.3-SNAPSHOT+internal` becomes the `snapshot-221018-113000-0000-internal` Docker tag. | ||
|=== |