use of io.fabric8.maven.docker.config.AssemblyConfiguration in project docker-maven-plugin by fabric8io.
the class DockerAssemblyManager method createBuildArchiver.
private TarArchiver createBuildArchiver(File outputDir, File archive, AssemblyConfiguration assemblyConfig) throws NoSuchArchiverException {
TarArchiver archiver = (TarArchiver) archiverManager.getArchiver("tar");
archiver.setLongfile(TarLongFileMode.posix);
AssemblyMode mode = assemblyConfig != null ? assemblyConfig.getMode() : null;
if (mode != null && mode.isArchive()) {
DefaultArchivedFileSet archiveSet = DefaultArchivedFileSet.archivedFileSet(new File(outputDir, assemblyConfig.getName() + "." + mode.getExtension()));
archiveSet.setPrefix(assemblyConfig.getName() + "/");
archiveSet.setIncludingEmptyDirectories(true);
archiveSet.setUsingDefaultExcludes(false);
archiver.addArchivedFileSet(archiveSet);
} else {
DefaultFileSet fileSet = DefaultFileSet.fileSet(outputDir);
fileSet.setUsingDefaultExcludes(false);
archiver.addFileSet(fileSet);
}
archiver.setDestFile(archive);
return archiver;
}
use of io.fabric8.maven.docker.config.AssemblyConfiguration in project docker-maven-plugin by fabric8io.
the class DockerAssemblyConfigurationSourceTest method permissionMode.
@SuppressWarnings("deprecation")
@Test
public void permissionMode() {
try {
new AssemblyConfiguration.Builder().permissions("blub").build();
} catch (IllegalArgumentException exp) {
assertTrue(exp.getMessage().contains("blub"));
}
AssemblyConfiguration config = new AssemblyConfiguration.Builder().ignorePermissions(false).permissions("ignore").build();
assertTrue(config.isIgnorePermissions());
;
}
use of io.fabric8.maven.docker.config.AssemblyConfiguration in project docker-maven-plugin by fabric8io.
the class DockerAssemblyManagerTest method testNoAssembly.
@Test
public void testNoAssembly() {
BuildImageConfiguration buildConfig = new BuildImageConfiguration();
AssemblyConfiguration assemblyConfig = buildConfig.getAssemblyConfiguration();
DockerFileBuilder builder = assemblyManager.createDockerFileBuilder(buildConfig, assemblyConfig);
String content = builder.content();
assertFalse(content.contains("COPY"));
assertFalse(content.contains("VOLUME"));
}
Aggregations