@Override public void install() { List<String> urls = resolver.getTargets(); String saveAs = resolver.getFilename(); List<String> commands = ImmutableList.<String> builder() .addAll(BashCommands.commandsToDownloadUrlsAs(urls, saveAs)) .add(BashCommands.INSTALL_TAR) .add("tar xzfv " + saveAs) .build(); newScript(INSTALLING) .body.append(commands) .execute(); }
@Override public void install() { List<String> urls = resolver.getTargets(); String saveAs = resolver.getFilename(); List<String> commands = new LinkedList<String>(); commands.addAll( BashCommands.commandsToDownloadUrlsAs(urls, saveAs)); commands.add(BashCommands.INSTALL_TAR); commands.add("tar xzfv "+saveAs); newScript(INSTALLING) .body.append(commands) .execute(); }
@Override public void install() { List<String> urls = resolver.getTargets(); String saveAs = resolver.getFilename(); List<String> commands = new LinkedList<String>(); commands.addAll(BashCommands.commandsToDownloadUrlsAs(urls, saveAs)); commands.add(BashCommands.INSTALL_UNZIP); commands.add("unzip "+saveAs); newScript(INSTALLING) .body.append(commands) .execute(); }
@Override public void install() { List<String> urls = resolver.getTargets(); String saveAs = resolver.getFilename(); List<String> commands = new LinkedList<String>(); commands.addAll(BashCommands.commandsToDownloadUrlsAs(urls, saveAs)); commands.add(BashCommands.INSTALL_TAR); commands.add("tar xzfv "+saveAs); newScript(INSTALLING) .body.append(commands) .execute(); }
@Override public void install() { List<String> urls = resolver.getTargets(); String saveAs = resolver.getFilename(); List<String> commands = new LinkedList<String>(); commands.add(BashCommands.INSTALL_TAR); commands.add(BashCommands.INSTALL_CURL); commands.add("echo installing extra packages"); commands.add(installPackage(ImmutableMap.of("yum", "libgcc_s.so.1"), null)); commands.add(installPackage(ImmutableMap.of("yum", "libaio.so.1 libncurses.so.5", "apt", "libaio1 libaio-dev"), null)); // these deps are needed on some OS versions but others don't need them so ignore failures (ok(...)) commands.add(ok(installPackage(ImmutableMap.of("yum", "libaio", "apt", "ia32-libs"), null))); commands.add("echo finished installing extra packages"); commands.addAll(commandsToDownloadUrlsAs(urls, saveAs)); commands.add(format("tar xfvz %s", saveAs)); newScript(INSTALLING).body.append(commands).execute(); }
@Override public void install() { List<String> urls = resolver.getTargets(); String saveAs = resolver.getFilename(); // Note the -o option to unzip, to overwrite existing files without warning. // The JBoss zip file contains lgpl.txt (at least) twice and the prompt to // overwrite interrupts the installer. List<String> commands = new LinkedList<String>(); commands.addAll(BashCommands.commandsToDownloadUrlsAs(urls, saveAs)); commands.add(BashCommands.INSTALL_UNZIP); commands.add(format("unzip -o %s",saveAs)); newScript(INSTALLING) .body.append(commands) .execute(); }
@Override public void install() { List<String> urls = resolver.getTargets(); String saveAs = resolver.getFilename(); List<String> commands = new LinkedList<String>(); commands.addAll(BashCommands.commandsToDownloadUrlsAs(urls, saveAs)); commands.add(BashCommands.INSTALL_TAR); commands.add("tar xzfv "+saveAs); commands.add("cd "+getExpandedInstallDir()); newScript(INSTALLING) .body.append(commands) .execute(); }
@Override public void install() { List<String> urls = resolver.getTargets(); String saveAs = resolver.getFilename(); List<String> commands = new LinkedList<String>(); commands.addAll(BashCommands.commandsToDownloadUrlsAs(urls, saveAs)); commands.add(BashCommands.INSTALL_TAR); commands.add(format("tar xvzf %s", saveAs)); newScript(INSTALLING) .environmentVariablesReset() .body.append(commands) .execute(); }
@Override public void install() { List<String> urls = resolver.getTargets(); String saveAs = resolver.getFilename(); List<String> commands = new LinkedList<String>(); commands.add(BashCommands.INSTALL_TAR); commands.add(BashCommands.INSTALL_CURL); commands.add("echo installing extra packages"); commands.add(installPackage(ImmutableMap.of("yum", "libgcc_s.so.1"), null)); commands.add(installPackage(ImmutableMap.of("yum", "libaio.so.1 libncurses.so.5", "apt", "libaio1 libaio-dev"), null)); // addresses https://issues.apache.org/jira/browse/BROOKLYN-300 commands.add(installPackage(ImmutableMap.of("yum", "perl", "apt", "perl"), null)); commands.add(installPackage(ImmutableMap.of("yum", "perl-Data-Dumper", "apt", "libdata-dumper-concise-perl"), null)); // these deps are only needed on some OS versions but others don't need them commands.add(installPackage(ImmutableMap.of("yum", "libaio", "apt", "ia32-libs"), null)); commands.add("echo finished installing extra packages"); commands.addAll(commandsToDownloadUrlsAs(urls, saveAs)); commands.add(format("tar xfvz %s", saveAs)); newScript(INSTALLING).body.append(commands).execute(); }
@Override public void install() { List<String> urls = resolver.getTargets(); String saveAs = resolver.getFilename(); List<String> commands = ImmutableList.<String>builder() .addAll(BashCommands.commandsToDownloadUrlsAs(urls, saveAs)) .add("tar xvfz "+saveAs) .build(); newScript(INSTALLING) .failOnNonZeroResultCode() .body.append(commands).execute(); }
@Override public void install() { List<String> urls = resolver.getTargets(); String saveAs = resolver.getFilename(); List<String> commands = new LinkedList<String>(); commands.addAll(BashCommands.commandsToDownloadUrlsAs(urls, saveAs)); commands.add(BashCommands.INSTALL_TAR); commands.add("tar xzfv " + saveAs); newScript(INSTALLING) // don't set vars yet -- it resolves dependencies (e.g. DB) which we don't want until we start .environmentVariablesReset() .body.append(commands) .execute(); }
@Override public void install() { List<String> urls = resolver.getTargets(); String saveAs = resolver.getFilename(); List<String> commands = ImmutableList.<String>builder() .addAll(BashCommands.commandsToDownloadUrlsAs(urls, saveAs)) .add(BashCommands.INSTALL_UNZIP) .add("unzip " + saveAs) .build(); newScript(INSTALLING) .body.append(commands) .failOnNonZeroResultCode() .execute(); }
@Override public void install() { List<String> commands = Lists.newLinkedList(); commands.addAll(BashCommands.commandsToDownloadUrlsAs(resolver.getTargets(), getCalicoCommand())); commands.add("chmod 755 " + getCalicoCommand()); commands.add(BashCommands.installPackage("ipset")); commands.add(sudo("modprobe ip6_tables")); commands.add(sudo("modprobe xt_set")); newScript(INSTALLING) .body.append(commands) .execute(); }
public void testDownloadUrl() throws Exception { List<String> cmds = BashCommands.commandsToDownloadUrlsAs( ImmutableList.of(sourceFileUrl1), destFile.getAbsolutePath()); int exitcode = loc.execCommands("test", cmds); assertEquals(0, exitcode); assertEquals(Files.readLines(destFile, Charsets.UTF_8), ImmutableList.of("mysource1")); }
@Test(groups="Integration") public void testDownloadFirstSuccessfulFile() throws Exception { List<String> cmds = BashCommands.commandsToDownloadUrlsAs( ImmutableList.of(sourceNonExistantFileUrl, sourceFileUrl1, sourceFileUrl2), destFile.getAbsolutePath()); int exitcode = loc.execCommands("test", cmds); assertEquals(0, exitcode); assertEquals(Files.readLines(destFile, Charsets.UTF_8), ImmutableList.of("mysource1")); }
@Override public void install() { List<String> commands = Lists.newLinkedList(); commands.addAll(BashCommands.commandsToDownloadUrlsAs(resolver.getTargets(), getWeaveCommand())); commands.add("chmod 755 " + getWeaveCommand()); newScript(INSTALLING) .body.append(commands) .execute(); }
@Override public void install() { List<String> urls = resolver.getTargets(); String saveAs = resolver.getFilename(); ImmutableList.Builder<String> commands= ImmutableList.<String> builder(); if (!getLocation().getOsDetails().isMac()) { commands.add(BashCommands.installPackage(ImmutableMap.of( "yum", "libuuid-devel", "apt", "build-essential uuid-dev pkg-config libtool automake"), "libuuid-devel")); commands.add(BashCommands.ifExecutableElse0("yum", BashCommands.sudo("yum -y groupinstall 'Development Tools'"))); } commands.add(BashCommands.installPackage(ImmutableMap.of("yum", "git"), "git")) .add(BashCommands.INSTALL_UNZIP) .addAll(installNativeDependencies()) .addAll(BashCommands.commandsToDownloadUrlsAs(urls, saveAs)) .add("unzip " + saveAs) .add("mkdir -p " + getLocalDir()) .add("chmod 777 " + getLocalDir()); // FIXME newScript(INSTALLING) .body.append(commands.build()) .gatherOutput() .execute(); }
"port", "erlang@"+getErlangVersion()+"+ssl"), "erlang")) .addAll(commandsToDownloadUrlsAs(urls, saveAs)) .add(installExecutable("tar")) .add(format("tar xvf %s",saveAs))
@Override public void install() { OsDetails osDetails = getMachine().getMachineDetails().getOsDetails(); if (!osDetails.isLinux()) { throw new IllegalStateException("Machine was not detected as linux: " + getMachine() + " Details: " + getMachine().getMachineDetails().getOsDetails()); } List<String> urls = resolver.getTargets(); String saveAs = resolver.getFilename(); List<String> commands = Lists.newArrayList(); commands.addAll(BashCommands.commandsToDownloadUrlsAs(urls, saveAs)); commands.add(BashCommands.INSTALL_TAR); commands.add(String.format("tar xvzf %s", saveAs)); newScript(INSTALLING) .body.append(commands) .failIfBodyEmpty() .failOnNonZeroResultCode() .execute(); }
commands.addAll(BashCommands.commandsToDownloadUrlsAs(urls, downloadedFilename)); commands.addAll(ArchiveUtils.installCommands(downloadedFilename));