This commit is contained in:
Nunzio Andrea Galante 2017-03-02 13:49:01 +00:00
parent 5ae31bfffd
commit 1ec0af6eb3
5 changed files with 30 additions and 5 deletions

View File

@ -243,16 +243,27 @@ public class AnsibleBridge {
if(pkg!=null) {
roles.addAll(pkg.getRoles(this.getTemplateManager()));
}
} else if("custom".equalsIgnoreCase(d.getType())) {
CustomDependencyPackage pkg = new CustomDependencyPackage(d);
if(pkg!=null) {
roles.addAll(pkg.getRoles(this.getCustomRoleManager()));
}
} else if("cran".equalsIgnoreCase(d.getType())) {
}
else if("github".equalsIgnoreCase(d.getType())) {
CranDependencyPackage pkg = new CranDependencyPackage(d);
if(pkg!=null) {
roles.addAll(pkg.getRoles(this.getTemplateManager()));
}
}
else if("cran".equalsIgnoreCase(d.getType())) {
CranDependencyPackage pkg = new CranDependencyPackage(d);
if(pkg!=null) {
roles.addAll(pkg.getRoles(this.getTemplateManager()));
}
}
return roles;
}

View File

@ -33,7 +33,7 @@ public class AlgorithmPackage {
String deps = "";
for(Dependency d:a.getDependencies()) {
deps+=String.format("- { role: %s }\n", d.getType()+"-"+d.getName());
deps+=String.format("- { role: %s }\n", d.getType()+"-"+d.getName().replaceAll("/", "-"));
}
deps = deps.trim();
out.put("dependencies", deps);

View File

@ -31,7 +31,7 @@ public class DependencyPackage {
public Collection<Role> getRoles(TemplateManager tm) {
Collection<Role> out = new Vector<>();
for(String mode:new String[]{"add"}) { // "remove", "update"
String roleName = this.getDependency().getType()+"-"+this.getDependency().getName()+("add".equals(mode) ? "" : "-"+mode);
String roleName = this.getDependency().getType()+"-"+this.getDependency().getName().replaceAll("/", "-")+("add".equals(mode) ? "" : "-"+mode);
try {
// find template
Role template = tm.getRoleTemplate(this.getDependency().getType()+"-package-"+mode);

View File

@ -212,7 +212,21 @@ public class AlgorithmPackageParser {
out.addDependency(dep);
}
}
List<String> gitdependencies = extractMultipleValues(metadata, "github");
if (gitdependencies != null) {
for (String pkg : gitdependencies) {
Dependency dep = new Dependency();
//if (pkg.startsWith("os:")){
dep.setName(pkg);
dep.setType("github");
out.addDependency(dep);
}
}
List<String> cdependencies = extractMultipleValues(metadata, "custom");

View File

@ -97,7 +97,7 @@ public class RestPoolManager implements PoolManager {
ScopeProvider.instance.set("/gcube/devNext/NextNext");
a.addAlgorithmToVRE(
"http://data.d4science.org/cXhJV0s4b3dUN05jZk9qTytQTndqdmVUdURLOTRHeHpHbWJQNStIS0N6Yz0",
"http://data.d4science.org/S2h1RHZGd0JpWnBjZk9qTytQTndqcDRLVHNrQUt6QjhHbWJQNStIS0N6Yz0",
"/gcube/devNext/NextNext",
null, null, "test", "transducerers", "N");