Package jetbrains.buildServer.agent
Interface ArtifactsPreprocessor
-
- All Superinterfaces:
AgentExtension
,TeamCityExtension
- All Known Implementing Classes:
ArchivePreprocessor
,BatchArchivePreprocessor
,SevenZPreprocessor
,TarPreprocessor
,ZipPreprocessor
public interface ArtifactsPreprocessor extends AgentExtension
The implementation of the interface allows to preprocess artifacts before publishing them using ArtifactsPublisher. The implementations of the interface are called before invoking artifacts publisher.- Since:
- 5.1
- See Also:
ArtifactsPublisher
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ArtifactsPreprocessor.SymbolicLinksMode
Represents how an archive processes symbolic links.
-
Field Summary
Fields Modifier and Type Field Description static String
TARGET_PATH_SEPARATOR
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description String
getTargetKey(String targetPath)
If this preprocessor can process given target path, return targetPath on server, which should be later be passed to #processArtifacts method.default void
processArtifacts(String targetPathOnServer, Map<File,String> filePathMap)
Deprecated.void
processArtifacts(String targetPathOnServer, Map<File,String> filePathMap, ArtifactsPreprocessor.SymbolicLinksMode mode)
Publishes files.void
setLogger(BuildProgressLogger logger)
Sets flow aware logger that allows to log messages in the same flow as corresponding jetbrains.buildServer.agent.ArtifactsPublisher
-
-
-
Field Detail
-
TARGET_PATH_SEPARATOR
@NonNls static final String TARGET_PATH_SEPARATOR
- Since:
- 2017.2.2
- See Also:
- Constant Field Values
-
-
Method Detail
-
getTargetKey
@Nullable String getTargetKey(String targetPath)
If this preprocessor can process given target path, return targetPath on server, which should be later be passed to #processArtifacts method. For instance, for input a.zip/sub/path this method should return a.zip If this processor cannot process targetPath, should return null
-
processArtifacts
void processArtifacts(String targetPathOnServer, @NotNull Map<File,String> filePathMap, @NotNull ArtifactsPreprocessor.SymbolicLinksMode mode) throws ArtifactPreprocessingFailedException
Publishes files. Note that publishing is performed from the agent messages queue and thus this method can be called when build on the agent is already finished. Usage example 1: gzip published file: file.txt => some/path.gz will gzip file.txt and convert map to path.gz => some/path.gz- Parameters:
targetPathOnServer
- target path on server, right part of "file.dmg => dist/" expressionfilePathMap
- map of the file to publish to its destination directory. This map can be altered by the implementation. For archives, target path may contain several entries separated byTARGET_PATH_SEPARATOR
, like file.txt => "a.zip!/foo/\na.zip!/bar/"mode
- simbolic links mode- Throws:
ArtifactPublishingFailedException
- if preprocessing failedArtifactPreprocessingFailedException
-
processArtifacts
@Deprecated default void processArtifacts(String targetPathOnServer, @NotNull Map<File,String> filePathMap) throws ArtifactPreprocessingFailedException
Deprecated.
-
setLogger
void setLogger(@NotNull BuildProgressLogger logger)
Sets flow aware logger that allows to log messages in the same flow as corresponding jetbrains.buildServer.agent.ArtifactsPublisher- Parameters:
logger
-
-
-