use of org.platformlayer.ops.packages.RecipeOperatingSystem in project platformlayer by platformlayer.
the class DesktopController method addChildren.
@Override
protected void addChildren() throws OpsException {
Desktop model = OpsContext.get().getInstance(Desktop.class);
InstanceBuilder instance = InstanceBuilder.build(model.dnsName, this, model.getTags());
instance.publicPorts.add(22);
instance.hostPolicy.allowRunInContainer = true;
instance.minimumMemoryMb = 4096;
addChild(instance);
{
RecipeOperatingSystem os = injected(RecipeOperatingSystem.class);
os.operatingSystem = new OperatingSystemRecipe();
os.operatingSystem.setDistribution("debian");
os.operatingSystem.setVersion("wheezy");
instance.addChild(os);
}
// We use curl for backups
instance.addChild(PackageDependency.build("curl"));
{
PublicEndpoint endpoint = injected(PublicEndpoint.class);
// endpoint.network = null;
endpoint.publicPort = 22;
endpoint.backendPort = 22;
endpoint.dnsName = model.dnsName;
endpoint.tagItem = model.getKey();
endpoint.parentItem = model.getKey();
instance.addChild(endpoint);
}
// {
// BackupDirectory backup = injected(BackupDirectory.class);
// backup.itemKey = model.getKey();
//
// File jenkinsRoot = new File("/var/lib/jenkins");
// backup.backupRoot = jenkinsRoot;
//
// String[] excludes = { "jobs/*/workspace", "jobs/*/modules", "jobs/*/builds/*/workspace.tar.gz",
// ".m2/repository" };
//
// for (String exclude : excludes) {
// backup.excludes.add(new File(jenkinsRoot, exclude));
// }
//
// instance.addChild(backup);
// }
}
Aggregations