Search in sources :

Example 6 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)

Example 7 with DownloadFileByHash

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

Example 8 with DownloadFileByHash

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

the class SimpleApp method buildDownload.

protected DownloadFileByHash buildDownload() {
    DownloadFileByHash download = injected(DownloadFileByHash.class);
    download.filePath = new File(jettyTemplate.getWarsStagingDir(), getWarName());
    download.specifier = context.source;
    return download;
}
Also used : DownloadFileByHash(org.platformlayer.ops.filesystem.DownloadFileByHash) TemplatedFile(org.platformlayer.ops.filesystem.TemplatedFile) PropertiesConfigFile(org.platformlayer.ops.standardservice.PropertiesConfigFile) File(java.io.File)

Example 9 with DownloadFileByHash

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

the class SimpleApp method addChildren.

@Override
protected void addChildren() throws OpsException {
    DownloadFileByHash download = addChild(buildDownload());
    File deployed = new File(jettyTemplate.getWarsDeployDir(), getWarName());
    addChild(ManagedSymlink.build(deployed, download.filePath));
    addChild(ManagedDirectory.build(getWorkDir(), "0700"));
    {
        PropertiesConfigFile conf = addChild(PropertiesConfigFile.class);
        conf.filePath = getConfigurationFilePath();
        conf.propertiesSupplier = new OpsProvider<Map<String, String>>() {

            @Override
            public Map<String, String> get() throws OpsException {
                return getConfigurationProperties();
            }
        };
    }
    File contextDir = jettyTemplate.getContextDir();
    ContextTemplate contextTemplate = new ContextTemplate();
    addChild(TemplatedFile.build(contextTemplate, new File(contextDir, "context.xml")));
}
Also used : DownloadFileByHash(org.platformlayer.ops.filesystem.DownloadFileByHash) PropertiesConfigFile(org.platformlayer.ops.standardservice.PropertiesConfigFile) OpsProvider(org.platformlayer.ops.OpsProvider) TemplatedFile(org.platformlayer.ops.filesystem.TemplatedFile) PropertiesConfigFile(org.platformlayer.ops.standardservice.PropertiesConfigFile) 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