Package io.fabric8.maven.docker.service
Class ArchiveService
- java.lang.Object
-
- io.fabric8.maven.docker.service.ArchiveService
-
public class ArchiveService extends Object
- Since:
- 30/11/15
- Author:
- roland
-
-
Constructor Summary
Constructors Constructor Description ArchiveService(DockerAssemblyManager dockerAssemblyManager, Logger log)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FilecreateChangedFilesArchive(List<AssemblyFiles.Entry> entries, File assemblyDir, String imageName, MojoParameters mojoParameters)Create an tar archive from a set of assembly files.FilecreateDockerBuildArchive(ImageConfiguration imageConfig, MojoParameters params)Create the tar file container the source for building an image.FilecreateDockerBuildArchive(ImageConfiguration imageConfig, MojoParameters params, ArchiverCustomizer customizer)Create the tar file container the source for building an image.AssemblyFilesgetAssemblyFiles(ImageConfiguration imageConfig, MojoParameters mojoParameters)Get a mapping of original to destination files which a covered by an assembly.
-
-
-
Constructor Detail
-
ArchiveService
public ArchiveService(DockerAssemblyManager dockerAssemblyManager, Logger log)
-
-
Method Detail
-
createDockerBuildArchive
public File createDockerBuildArchive(ImageConfiguration imageConfig, MojoParameters params) throws org.apache.maven.plugin.MojoExecutionException
Create the tar file container the source for building an image. This tar can be used directly for uploading to a Docker daemon for creating the image- Parameters:
imageConfig- the image configurationparams- mojo params for the project- Returns:
- file for holding the sources
- Throws:
org.apache.maven.plugin.MojoExecutionException- if during creation of the tar an error occurs.
-
createDockerBuildArchive
public File createDockerBuildArchive(ImageConfiguration imageConfig, MojoParameters params, ArchiverCustomizer customizer) throws org.apache.maven.plugin.MojoExecutionException
Create the tar file container the source for building an image. This tar can be used directly for uploading to a Docker daemon for creating the image- Parameters:
imageConfig- the image configurationparams- mojo params for the projectcustomizer- final customizer to be applied to the tar before being generated- Returns:
- file for holding the sources
- Throws:
org.apache.maven.plugin.MojoExecutionException- if during creation of the tar an error occurs.
-
getAssemblyFiles
public AssemblyFiles getAssemblyFiles(ImageConfiguration imageConfig, MojoParameters mojoParameters) throws org.apache.maven.plugin.MojoExecutionException
Get a mapping of original to destination files which a covered by an assembly. This can be used to watch the source files for changes in order to update the target (either by recreating a docker image or by copying it into a running container)- Parameters:
imageConfig- image config for which to get files. The build- and assembly configuration in this image config must not be null.mojoParameters- needed for tracking the assembly- Returns:
- mapping of assembly files
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
createChangedFilesArchive
public File createChangedFilesArchive(List<AssemblyFiles.Entry> entries, File assemblyDir, String imageName, MojoParameters mojoParameters) throws org.apache.maven.plugin.MojoExecutionException
Create an tar archive from a set of assembly files. Only files which changed since the last call are included.- Parameters:
entries- changed files. List must not be empty or nullimageName- image's namemojoParameters-- Returns:
- created archive
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
-