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);
}
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;
}
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;
}
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);
}
Aggregations