Commit a2c97f0b authored by Maxime Lefrançois's avatar Maxime Lefrançois
Browse files

nits

parent 575e66d0
mvn exec:java -Dexec.mainClass="fr.emse.gitlab.saref.Main" -Dexec.args="-d ../saref-core"
mvn exec:java -Dexec.args="-d ../saref-core"
......@@ -34,7 +34,6 @@ public class Constants {
public static final String STATIC_TARGET_DIR = SITE_DIR + File.separator + "static";
public static final String SAREF_ACCESS_TOKEN = "SAREF_ACCESS_TOKEN";
public static final String SAREF_ACCESS_USERNAME = "SAREF_ACCESS_USERNAME";
public static final String propertyFile = ".saref-repositories";
......
......@@ -45,6 +45,7 @@ import fr.emse.gitlab.saref.jobs.WriteRDFFiles;
import fr.emse.gitlab.saref.jobs.CheckOWLProfile;
import fr.emse.gitlab.saref.jobs.CheckRepositoryStructure;
import fr.emse.gitlab.saref.jobs.CheckShapes;
import fr.emse.gitlab.saref.jobs.CopyStaticFiles;
public class Main {
......@@ -93,12 +94,13 @@ public class Main {
LOG.info("Starting pipeline");
doJob(new CheckRepositoryStructure(directory));
doJob(new CheckShapes(directory));
Repositories repositories = doJob(new ReadRepositories(directory));
Dataset dataset = doJob(new CreateDataset(directory, repositories));
doJob(new CopyStaticFiles(directory));
Set<OWLOntologyIRIMapper> mappers = doJob(new WriteRDFFiles(directory, dataset));
doJob(new CheckOWLProfile(directory, mappers));
// doJob(new CheckShapes(directory));
// Repositories repositories = doJob(new ReadRepositories(directory));
// Repositories repositories = new Repositories();
// Dataset dataset = doJob(new CreateDataset(directory, repositories));
// doJob(new CopyStaticFiles(directory));
// Set<OWLOntologyIRIMapper> mappers = doJob(new WriteRDFFiles(directory, dataset));
// doJob(new CheckOWLProfile(directory, mappers));
reportAndExit(0);
}
......
......@@ -49,9 +49,7 @@ public class CheckRepositoryStructure extends AbstractJobRunner<Void> {
private void checkThereExistsDirectory(String dirName) {
final File dir = new File(directory, dirName);
try {
if (dir.isDirectory()) {
success(String.format("There exists a folder named `%s`", dirName));
} else {
if (!dir.isDirectory()) {
failure(String.format("There should exist a folder named `%s`", dirName));
}
} catch (SecurityException ex) {
......
......@@ -30,7 +30,8 @@ public class CheckShapes extends AbstractJobRunner<Void> {
static final String SELECT_VIOLATION = "PREFIX sh: <http://www.w3.org/ns/shacl#>\n"
+ "SELECT ?focusNode ?resultMessage ?resultPath ?value ?severity\n" + "WHERE { \n"
+ " ?violation sh:focusNode ?focusNode .\n" + " ?violation sh:resultMessage ?resultMessage .\n"
+ " ?violation sh:focusNode ?focusNode .\n"
+ " ?violation sh:resultMessage ?resultMessage .\n"
+ " ?violation sh:resultSeverity ?severity .\n"
+ " OPTIONAL { ?violation sh:resultPath ?resultPath . }\n"
+ " OPTIONAL { ?violation sh:value ?value . } \n" + "}";
......
package fr.emse.gitlab.saref;
package fr.emse.gitlab.saref.jobs;
import java.io.File;
import org.apache.commons.io.FileUtils;
import fr.emse.gitlab.saref.jobs.AbstractJobRunner;
import fr.emse.gitlab.saref.Constants;
import fr.emse.gitlab.saref.Main;
public class CopyStaticFiles extends AbstractJobRunner<Void> {
......
......@@ -82,6 +82,9 @@ public class ReadRepositories extends AbstractJobRunner<Repositories> {
File repoDir = new File(directory, Constants.GIT_DIR);
try {
FileUtils.forceDelete(repoDir);
} catch (IOException ex) {
}
try {
FileUtils.forceMkdir(repoDir);
} catch (IOException ex) {
error(String.format("Error while creating repository directory %s", repoDir.getPath()), ex);
......@@ -124,7 +127,7 @@ public class ReadRepositories extends AbstractJobRunner<Repositories> {
} else {
if (console != null) {
username = console
.readLine(String.format("Please enter your EOL account username for %s:\n", hostName));
.readLine(String.format("Please enter your account username for %s:\n", hostName));
} else if (System.getenv("GITLAB_CI") != null) {
LOG.info("using username 'gitlab-ci-token'");
username = "gitlab-ci-token";
......@@ -138,7 +141,7 @@ public class ReadRepositories extends AbstractJobRunner<Repositories> {
} else {
if (console != null) {
password = console
.readPassword(String.format("Please enter your EOL account password for %s:\n", hostName));
.readPassword(String.format("Please enter your account password for %s:\n", hostName));
} else if (System.getenv("GITLAB_CI") != null) {
password = System.getenv("CI_JOB_TOKEN").toCharArray();
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment