use of com.hazelcast.simulator.utils.BashCommand in project hazelcast-simulator by hazelcast.
the class ScriptExecutor method newBashScriptCallable.
private Callable<String> newBashScriptCallable(final String command) {
Callable<String> task;
task = new Callable<String>() {
@Override
public String call() throws Exception {
Map<String, Object> environment = new HashMap<String, Object>();
environment.put("PID", NativeUtils.getPID());
return new BashCommand(command).setDirectory(getUserDir()).addEnvironment(environment).setThrowsException(true).execute();
}
};
return task;
}
use of com.hazelcast.simulator.utils.BashCommand in project hazelcast-simulator by hazelcast.
the class HazelcastDriver method install.
@Override
public void install() {
String cloud = get("CLOUD_PROVIDER");
if ("embedded".equals(cloud)) {
return;
}
String versionSpec = get("VERSION_SPEC");
LOGGER.info("Installing versionSpec [" + versionSpec + "] on " + agents.size() + " agents...");
String publicIps = "";
if (!"local".equals(cloud)) {
publicIps = AgentData.publicAddressesString(agents);
}
String vendor = get("VENDOR");
String installFile = getConfigurationFile("install-" + vendor + ".sh").getPath();
LOGGER.info("Installing '" + vendor + "' version '" + versionSpec + "' on Agents using " + installFile);
new BashCommand(installFile).addParams(get("SESSION_ID"), versionSpec, publicIps).addEnvironment(properties).execute();
LOGGER.info("Successfully installed '" + vendor + "'");
LOGGER.info("Install successful!");
}
Aggregations