public class ConfigurationPropertyValidator extends Object
Modifier and Type | Method and Description |
---|---|
static ImageReference |
getGeneratedTargetDockerTag(String targetImage,
JibLogger logger,
String projectName,
String projectVersion,
HelpfulSuggestions helpfulSuggestions)
Returns an
ImageReference parsed from the configured target image, or one of the form
project-name:project-version if target image is not configured |
static Optional<Credential> |
getImageCredential(JibLogger logger,
String usernameProperty,
String passwordProperty,
AuthProperty auth)
Gets a
Credential from a username and password. |
public static Optional<Credential> getImageCredential(JibLogger logger, String usernameProperty, String passwordProperty, AuthProperty auth)
Credential
from a username and password. First tries system properties, then
tries build configuration, otherwise returns null.logger
- the JibLogger
used to print warnings messagesusernameProperty
- the name of the username system propertypasswordProperty
- the name of the password system propertyauth
- the configured credentialsAuthorization
from the system properties or build configuration, or
Optional.empty()
if neither is configured.public static ImageReference getGeneratedTargetDockerTag(@Nullable String targetImage, JibLogger logger, String projectName, String projectVersion, HelpfulSuggestions helpfulSuggestions) throws InvalidImageReferenceException
ImageReference
parsed from the configured target image, or one of the form
project-name:project-version
if target image is not configuredtargetImage
- the configured target image referencelogger
- the JibLogger
used to show messagesprojectName
- the project name, as determined by the pluginprojectVersion
- the project version, as determined by the pluginhelpfulSuggestions
- used for generating the message notifying the user of the generated
tagImageReference
parsed from the configured target image, or one of the form
project-name:project-version
if target image is not configuredInvalidImageReferenceException
- if the configured or generated image reference is
invalidCopyright © 2018. All rights reserved.