Search in sources :

Example 1 with CasStoreInfo

use of org.platformlayer.cas.CasStoreInfo in project platformlayer by platformlayer.

the class CasStoreHelper method buildJenkins.

private static JenkinsCasStore buildJenkins(String baseUrl) {
    HttpClient httpClient = new DefaultHttpClient();
    JenkinsClient jenkinsClient;
    try {
        jenkinsClient = new JenkinsClient(httpClient, new URI(baseUrl));
    } catch (URISyntaxException e) {
        throw new IllegalArgumentException("Error parsing URI", e);
    }
    return new JenkinsCasStore(new CasStoreInfo(false), jenkinsClient);
}
Also used : CasStoreInfo(org.platformlayer.cas.CasStoreInfo) JenkinsClient(org.platformlayer.ops.cas.jenkins.JenkinsClient) JenkinsCasStore(org.platformlayer.ops.cas.jenkins.JenkinsCasStore) DefaultHttpClient(org.apache.http.impl.client.DefaultHttpClient) HttpClient(org.apache.http.client.HttpClient) URISyntaxException(java.net.URISyntaxException) URI(java.net.URI) DefaultHttpClient(org.apache.http.impl.client.DefaultHttpClient)

Example 2 with CasStoreInfo

use of org.platformlayer.cas.CasStoreInfo in project platformlayer by platformlayer.

the class CasStoreHelper method getCasStoreMap.

public CasStoreMap getCasStoreMap(OpsTarget target) throws OpsException {
    // TODO: Reintroduce (some) caching?
    // if (this.casStores == null) {
    CasStoreMap casStores = new CasStoreMap();
    FilesystemCasStore filesystemCasStore = new FilesystemCasStore(new CasStoreInfo(false), new OpsCasTarget(target));
    casStores.addPrimary(filesystemCasStore);
    // TODO: Don't hard-code
    casStores.addSecondary(buildJenkins("http://192.168.131.14:8080/"));
    for (ProviderOf<CasStoreProvider> casStoreProvider : providers.listItemsProviding(CasStoreProvider.class)) {
        CasStore casStore = casStoreProvider.get().getCasStore();
        casStores.addSecondary(casStore);
        if (casStore.getOptions().isStaging()) {
            // Use this as a staging store i.e. we can upload files to here instead of to the VM
            casStores.addStagingStore(casStore);
        }
    }
    // }
    return casStores;
}
Also used : CasStoreMap(org.platformlayer.cas.CasStoreMap) CasStoreInfo(org.platformlayer.cas.CasStoreInfo) FilesystemCasStore(org.platformlayer.ops.cas.filesystem.FilesystemCasStore) JenkinsCasStore(org.platformlayer.ops.cas.jenkins.JenkinsCasStore) CasStore(org.platformlayer.cas.CasStore) FilesystemCasStore(org.platformlayer.ops.cas.filesystem.FilesystemCasStore)

Example 3 with CasStoreInfo

use of org.platformlayer.cas.CasStoreInfo in project platformlayer by platformlayer.

the class DirectHostController method getCasStore.

@Override
public CasStore getCasStore() throws OpsException {
    // TODO: Getting the IP like this is evil
    NetworkPoint targetAddress;
    // if (host.getIpv6() != null) {
    // IpRange ipv6Range = IpV6Range.parse(host.getIpv6());
    // targetAddress = NetworkPoint.forPublicHostname(ipv6Range.getGatewayAddress());
    // } else {
    targetAddress = NetworkPoint.forPublicHostname(model.host);
    // }
    Machine machine = new OpaqueMachine(targetAddress);
    OpsTarget machineTarget = machine.getTarget(sshKeys.findOtherServiceKey(new ServiceType("machines-direct")));
    CasStoreInfo casStoreOptions = new CasStoreInfo(true);
    FilesystemCasStore store = new FilesystemCasStore(casStoreOptions, new OpsCasTarget(machineTarget));
    return store;
}
Also used : CasStoreInfo(org.platformlayer.cas.CasStoreInfo) OpsTarget(org.platformlayer.ops.OpsTarget) FilesystemCasStore(org.platformlayer.ops.cas.filesystem.FilesystemCasStore) ServiceType(org.platformlayer.ids.ServiceType) OpaqueMachine(org.platformlayer.ops.OpaqueMachine) OpsCasTarget(org.platformlayer.ops.cas.OpsCasTarget) NetworkPoint(org.platformlayer.ops.networks.NetworkPoint) Machine(org.platformlayer.ops.Machine) OpaqueMachine(org.platformlayer.ops.OpaqueMachine)

Example 4 with CasStoreInfo

use of org.platformlayer.cas.CasStoreInfo in project platformlayer by platformlayer.

the class OpenstackCloudController method getCasStore.

@Override
public OpenstackCasStore getCasStore() {
    OpenstackCredentials credential = new OpenstackCredentials(model.endpoint, model.username, model.password.plaintext(), model.tenant);
    String containerName = "platformlayer-artifacts";
    return new OpenstackCasStore(new CasStoreInfo(false), credential, containerName);
}
Also used : CasStoreInfo(org.platformlayer.cas.CasStoreInfo) OpenstackCredentials(org.openstack.client.OpenstackCredentials)

Aggregations

CasStoreInfo (org.platformlayer.cas.CasStoreInfo)4 FilesystemCasStore (org.platformlayer.ops.cas.filesystem.FilesystemCasStore)2 JenkinsCasStore (org.platformlayer.ops.cas.jenkins.JenkinsCasStore)2 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 HttpClient (org.apache.http.client.HttpClient)1 DefaultHttpClient (org.apache.http.impl.client.DefaultHttpClient)1 OpenstackCredentials (org.openstack.client.OpenstackCredentials)1 CasStore (org.platformlayer.cas.CasStore)1 CasStoreMap (org.platformlayer.cas.CasStoreMap)1 ServiceType (org.platformlayer.ids.ServiceType)1 Machine (org.platformlayer.ops.Machine)1 OpaqueMachine (org.platformlayer.ops.OpaqueMachine)1 OpsTarget (org.platformlayer.ops.OpsTarget)1 OpsCasTarget (org.platformlayer.ops.cas.OpsCasTarget)1 JenkinsClient (org.platformlayer.ops.cas.jenkins.JenkinsClient)1 NetworkPoint (org.platformlayer.ops.networks.NetworkPoint)1