use of org.platformlayer.ops.filesystem.ExpandArchive in project platformlayer by platformlayer.
the class StandardServiceInstall method addChildren.
@Override
protected void addChildren() throws OpsException {
StandardTemplateData template = getTemplate();
serviceManager.addServiceInstall(template.getModel().getKey(), this);
String user = template.getUser();
String group = template.getGroup();
addChild(PosixGroup.build(user));
addChild(PosixUser.build(user, false, group));
File installDir = template.getInstallDir();
{
DownloadFileByHash download = buildDownload();
if (download != null) {
addChild(download);
}
if (download != null && template.shouldExpand()) {
// TODO: Only unzip if newly downloaded
ExpandArchive unzip = addChild(ExpandArchive.class);
unzip.archiveFile = download.filePath;
unzip.extractPath = installDir;
}
}
addChild(JavaVirtualMachine.buildJre7());
}
use of org.platformlayer.ops.filesystem.ExpandArchive in project platformlayer by platformlayer.
the class SolrInstall method addChildren.
@Override
protected void addChildren() throws OpsException {
addChild(JavaVirtualMachine.buildJava6());
// addChild(injected(JettyInstall.class));
addChild(injected(SupervisordInstall.class));
{
// TODO: Would be nice not to hard code this mirror
String apacheMirror = "http://apache.osuosl.org/";
// This probably does need to be hard-coded though
// (though maybe selectable from a list of supported releases)
String file = "lucene/solr/3.6.0/apache-solr-3.6.0.tgz";
Md5Hash hash = new Md5Hash("ac11ef4408bb015aa3a5eefcb1047aec");
File basePath = new File("/opt/");
File zipFile = new File(basePath, "apache-solr-3.6.0.tgz");
File extractPath = new File(basePath, "apache-solr-3.6.0");
DownloadFileByHash download = injected(DownloadFileByHash.class);
download.setUrl(apacheMirror + file);
download.hash = hash;
download.filePath = zipFile;
addChild(download);
// Needed for ExpandArchive
addChild(PackageDependency.build("unzip"));
// TODO: Only unzip if newly downloaded
ExpandArchive unzip = injected(ExpandArchive.class);
unzip.archiveFile = zipFile;
unzip.extractPath = extractPath;
addChild(unzip);
}
addChild(PosixGroup.build("solr"));
addChild(PosixUser.build("solr", false, "solr"));
}
use of org.platformlayer.ops.filesystem.ExpandArchive in project platformlayer by platformlayer.
the class PlatformLayerInstall method addService.
private void addService(String key) throws OpsException {
DownloadFileByHash download = addChild(DownloadFileByHash.class);
download.filePath = new File(template.getServicesPath(), key + ".tar.gz");
download.specifier = "platformlayerplus:production:" + key + "-1.0-SNAPSHOT-service-package.tar.gz";
// TODO: Only unzip if newly downloaded
ExpandArchive unzip = addChild(ExpandArchive.class);
unzip.archiveFile = download.filePath;
unzip.extractPath = template.getServicesPath();
}
Aggregations