use of org.jreleaser.util.command.Command in project jreleaser by jreleaser.
the class Upx method compress.
public void compress(Path parent, List<String> args) throws CommandException {
Command command = tool.asCommand().args(args);
executeCommand(() -> new CommandExecutor(context.getLogger()).executeCommand(parent, command));
}
use of org.jreleaser.util.command.Command in project jreleaser by jreleaser.
the class ChocolateyPackagerProcessor method createChocolateyPackage.
private void createChocolateyPackage(Distribution distribution, Map<String, Object> props) throws PackagerProcessingException {
Path packageDirectory = (Path) props.get(KEY_DISTRIBUTION_PACKAGE_DIRECTORY);
Path execDirectory = packageDirectory.resolve(distribution.getName());
Command cmd = new Command("choco").arg("pack").arg(packager.getPackageName() + ".nuspec");
context.getLogger().debug(String.join(" ", cmd.getArgs()));
executeCommand(execDirectory, cmd);
}
use of org.jreleaser.util.command.Command in project jreleaser by jreleaser.
the class DockerPackagerProcessor method publish.
private void publish(Registry registry, String imageName, Map<String, Object> props) throws PackagerProcessingException {
imageName = resolveTemplate(imageName, props);
String tag = imageName;
String serverName = registry.getServerName();
String server = registry.getServer();
String repositoryName = registry.getRepositoryName();
if (Registry.DEFAULT_NAME.equals(serverName)) {
if (!tag.startsWith(repositoryName)) {
int pos = tag.indexOf("/");
if (pos < 0) {
tag = repositoryName + "/" + tag;
} else {
tag = repositoryName + tag.substring(pos);
}
}
} else {
if (!tag.startsWith(server)) {
int pos = tag.indexOf("/");
if (pos < 0) {
tag = server + "/" + repositoryName + "/" + tag;
} else {
tag = server + "/" + repositoryName + tag.substring(pos);
}
}
}
if (!tag.equals(imageName)) {
Command cmd = createCommand("tag").arg(imageName).arg(tag);
context.getLogger().debug(RB.$("docker.tag"), imageName, tag);
if (!context.isDryrun())
executeCommand(cmd);
}
Command cmd = createCommand("push").arg("-q").arg(tag);
context.getLogger().info(" - {}", tag);
context.getLogger().debug(RB.$("docker.push"), tag, registry.getServerName(), (isNotBlank(registry.getServer()) ? " (" + registry.getServer() + ")" : ""));
if (!context.isDryrun())
executeCommand(cmd);
}
use of org.jreleaser.util.command.Command in project jreleaser by jreleaser.
the class DockerPackagerProcessor method logout.
private void logout(Registry registry) throws PackagerProcessingException {
Command cmd = createCommand("logout");
if (isNotBlank(registry.getServer())) {
cmd.arg(registry.getServerName());
}
context.getLogger().debug(RB.$("docker.logout"), registry.getServerName(), (isNotBlank(registry.getServer()) ? " (" + registry.getServer() + ")" : ""));
if (!context.isDryrun())
executeCommand(cmd);
}
use of org.jreleaser.util.command.Command in project jreleaser by jreleaser.
the class SnapPackagerProcessor method createSnap.
private void createSnap(Distribution distribution, Map<String, Object> props) throws PackagerProcessingException {
Path packageDirectory = (Path) props.get(KEY_DISTRIBUTION_PACKAGE_DIRECTORY);
String version = (String) props.get(KEY_PROJECT_EFFECTIVE_VERSION);
String snapName = packager.getPackageName() + "-" + version + ".snap";
Command cmd = new Command("snapcraft").arg("snap").arg("--output").arg(snapName);
executeCommand(packageDirectory, cmd);
}
Aggregations