Search in sources :

Example 1 with ExpandArchive

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());
}
Also used : DownloadFileByHash(org.platformlayer.ops.filesystem.DownloadFileByHash) File(java.io.File) ExpandArchive(org.platformlayer.ops.filesystem.ExpandArchive)

Example 2 with ExpandArchive

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"));
}
Also used : DownloadFileByHash(org.platformlayer.ops.filesystem.DownloadFileByHash) Md5Hash(com.fathomdb.hash.Md5Hash) File(java.io.File) SupervisordInstall(org.platformlayer.ops.supervisor.SupervisordInstall) ExpandArchive(org.platformlayer.ops.filesystem.ExpandArchive)

Example 3 with ExpandArchive

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();
}
Also used : DownloadFileByHash(org.platformlayer.ops.filesystem.DownloadFileByHash) File(java.io.File) ExpandArchive(org.platformlayer.ops.filesystem.ExpandArchive)

Aggregations

File (java.io.File)3 DownloadFileByHash (org.platformlayer.ops.filesystem.DownloadFileByHash)3 ExpandArchive (org.platformlayer.ops.filesystem.ExpandArchive)3 Md5Hash (com.fathomdb.hash.Md5Hash)1 SupervisordInstall (org.platformlayer.ops.supervisor.SupervisordInstall)1