Package nl.lexemmens.podman.helper
Class ImageNameHelper
- java.lang.Object
-
- nl.lexemmens.podman.helper.ImageNameHelper
-
public class ImageNameHelper extends Object
Helper class to format image names.Supported formatter options:
- %a: Results in the artifactId (sanitized)
- %d: Results in the directory that contains the Containerfile
- %g: Results in the last part of the groupId (after the last .)
- %n: Results in a number (starting at 0)
- %l: Results in 'latest' in case the current version is a SNAPSHOT. Otherwise version of the project
- %t: Results in 'snapshot-[timestamp]'
- %v: Results in the version of the project
-
-
Constructor Summary
Constructors Constructor Description ImageNameHelper(org.apache.maven.project.MavenProject mavenProject)Constructs a new instance of thisImageNameHelper
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadaptReplacemeents(SingleImageConfiguration imageConfiguration)Adapt some replacements based on the newSingleImageConfiguration.voidformatImageName(SingleImageConfiguration imageConfiguration)Formats the imageName according to the specifications from this class.
-
-
-
Constructor Detail
-
ImageNameHelper
public ImageNameHelper(org.apache.maven.project.MavenProject mavenProject)
Constructs a new instance of thisImageNameHelper- Parameters:
mavenProject- The MavenProject to use
-
-
Method Detail
-
adaptReplacemeents
public void adaptReplacemeents(SingleImageConfiguration imageConfiguration)
Adapt some replacements based on the newSingleImageConfiguration.Some replacements may be based on some properties from the
SingleImageConfiguration. This method ensures that they are all adapted and that the call toformatImageName(SingleImageConfiguration)returns the correct value.- Parameters:
imageConfiguration- TheSingleImageConfigurationto use
-
formatImageName
public void formatImageName(SingleImageConfiguration imageConfiguration)
Formats the imageName according to the specifications from this class. Both image names as specified in the 'name' tag and the 'imageName' tag (part of the stage section) are being proessed.- Parameters:
imageConfiguration- The imageConfiguration containing the image names to format.
-
-