Search in sources :

Example 1 with DownloadFileByHash

use of org.platformlayer.ops.filesystem.DownloadFileByHash 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 DownloadFileByHash

use of org.platformlayer.ops.filesystem.DownloadFileByHash in project platformlayer by platformlayer.

the class StandardServiceInstall method buildDownload.

protected DownloadFileByHash buildDownload() {
    StandardTemplateData template = getTemplate();
    String specifier = template.getDownloadSpecifier();
    if (specifier == null) {
        return null;
    }
    // TODO: Auto-update this?? Add JenkinsLatest?
    File zipFile = template.getDistFile();
    // TODO: CAS / Cache?
    DownloadFileByHash download = injected(DownloadFileByHash.class);
    download.filePath = zipFile;
    download.specifier = specifier;
    return download;
}
Also used : DownloadFileByHash(org.platformlayer.ops.filesystem.DownloadFileByHash) File(java.io.File)

Example 3 with DownloadFileByHash

use of org.platformlayer.ops.filesystem.DownloadFileByHash 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 4 with DownloadFileByHash

use of org.platformlayer.ops.filesystem.DownloadFileByHash in project platformlayer by platformlayer.

the class ZookeeperInstall method buildDownload.

@Override
protected DownloadFileByHash buildDownload() {
    DownloadFileByHash download = super.buildDownload();
    // TODO: Would be nice not to hard code this mirror
    // String apacheMirror = "http://ftp.osuosl.org/pub/apache/";
    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 url = apacheMirror + "zookeeper/zookeeper-3.3.5/zookeeper-3.3.5.tar.gz";
    // download.setUrl(url);
    // download.hash = new Md5Hash("4c2c969bce8717d6443e184ff91dfdc7");
    String url = apacheMirror + "zookeeper/zookeeper-3.4.5/zookeeper-3.4.5.tar.gz";
    download.setUrl(url);
    download.hash = new Md5Hash("f64fef86c0bf2e5e0484d19425b22dcb");
    return download;
}
Also used : DownloadFileByHash(org.platformlayer.ops.filesystem.DownloadFileByHash) Md5Hash(com.fathomdb.hash.Md5Hash)

Example 5 with DownloadFileByHash

use of org.platformlayer.ops.filesystem.DownloadFileByHash in project platformlayer by platformlayer.

the class UserAuthInstall method addChildren.

@Override
protected void addChildren() throws OpsException {
    super.addChildren();
    for (String extension : template.getExtensions()) {
        String key = extension;
        DownloadFileByHash download = addChild(DownloadFileByHash.class);
        download.filePath = new File(template.getExtensionsPath(), key + ".jar");
        download.specifier = "platformlayerplus:production:" + key + "-1.0-SNAPSHOT.jar";
    }
}
Also used : DownloadFileByHash(org.platformlayer.ops.filesystem.DownloadFileByHash) File(java.io.File)

Aggregations

DownloadFileByHash (org.platformlayer.ops.filesystem.DownloadFileByHash)9 File (java.io.File)7 Md5Hash (com.fathomdb.hash.Md5Hash)3 ExpandArchive (org.platformlayer.ops.filesystem.ExpandArchive)3 TemplatedFile (org.platformlayer.ops.filesystem.TemplatedFile)2 PropertiesConfigFile (org.platformlayer.ops.standardservice.PropertiesConfigFile)2 OpsProvider (org.platformlayer.ops.OpsProvider)1 SupervisordInstall (org.platformlayer.ops.supervisor.SupervisordInstall)1