Commit a2cde1df authored by Maxime Lefrançois's avatar Maxime Lefrançois

soon over ? getting tired

parent 95b2eae4
Pipeline #3828 passed with stage
in 2 minutes and 1 second
......@@ -86,8 +86,11 @@ public class CLIExecution implements SAREFCredentialsProvider {
case "develop":
mode = Mode.DEVELOP;
break;
case "portal":
mode = Mode.PORTAL;
case "prerelease-portal":
mode = Mode.PRERELEASE_PORTAL;
break;
case "release-portal":
mode = Mode.RELEASE_PORTAL;
break;
case "release":
mode = Mode.RELEASE;
......@@ -99,7 +102,7 @@ public class CLIExecution implements SAREFCredentialsProvider {
displayHelp(0);
throw new RuntimeException();
default:
LOG.error(String.format("<mode> %s is invalid. Valid modes are develop, portal, release, help.", args[0]));
LOG.error(String.format("<mode> %s is invalid. Valid modes are develop, portal, prerelease-portal, release-portal, help.", args[0]));
displayHelp(-1);
throw new RuntimeException();
}
......
......@@ -67,6 +67,9 @@ public class SAREF {
public static final String LOGGER_BASE = "SAREF Pipeline: ";
public static final String NAME_SITE = "site";
public static final String NAME_SOURCES = "sources";
public static final String NAME_SOURCES_PORTAL = "portal";
// project acronym
public static final String REGEX_ACRONYM_VAR = "acronym";
......
......@@ -56,7 +56,7 @@ public class SAREFPipeline {
private static final String NAME_LOG_FILE = "output.log";
public static enum Mode {
DEVELOP, RELEASE, PORTAL, CLEAN
DEVELOP, RELEASE, PRERELEASE_PORTAL, RELEASE_PORTAL, CLEAN
}
private final TestSuites testSuites = new TestSuites("SAREF pipeline");
......@@ -131,7 +131,7 @@ public class SAREFPipeline {
sourcesManager.checkTerms();
sourcesManager.generateSite();
sourcesManager.resetCheckout();
if(mode == Mode.PORTAL) {
if(mode == Mode.PRERELEASE_PORTAL || mode == Mode.RELEASE_PORTAL) {
datasetManager = new DatasetManager(this, logger);
datasetManager.createDataset();
}
......
......@@ -118,10 +118,14 @@ public class Clause_9_4_5_Checker extends AbstractClauseChecker {
}
});
}
checkOops();
try {
checkOops();
} catch (Exception ex) {
logWarning(getMessage(MESSAGE.oopsError), ex);
}
}
public void checkOops() throws SAREFPipelineException {
public void checkOops() throws Exception {
ByteArrayOutputStream out = new ByteArrayOutputStream();
String onto = "";
......
......@@ -25,7 +25,11 @@
*/
package fr.emse.gitlab.saref.checkers;
import java.io.*;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.StringWriter;
import java.nio.charset.StandardCharsets;
import java.nio.file.FileSystems;
import java.nio.file.PathMatcher;
......@@ -97,8 +101,14 @@ public class Clause_9_5_Checker extends AbstractClauseChecker {
return;
}
readTests(); // generates the RDF model for the tests
callThemis(); // uses the RDF model for the tests and sends it to ThemisOWL profile, consistency, lack of pitfalls and class satisfiability
testsRDFaGenerator(); // this generates the html file with rdfa embedded.
try {
callThemis(); // uses the RDF model for the tests and sends it to ThemisOWL profile, consistency, lack of pitfalls and class satisfiability
testsRDFaGenerator(); // this generates the html file with rdfa embedded.
} catch (Exception ex) {
logWarning(getMessage(MESSAGE.themis), ex);
}
} catch (IOException ex) {
logError(getMessage(MESSAGE.ioexception));
}
......
......@@ -46,7 +46,8 @@ public class FunctionalitiesPanel extends JPanel {
final JButton fileChooser;
final JRadioButton develop;
final JRadioButton release;
final JRadioButton portal;
final JRadioButton prerelease_portal;
final JRadioButton release_portal;
final JCheckBox ignoreSite;
final JCheckBox ignoreExamples;
final JCheckBox ignoreTerms;
......@@ -78,26 +79,38 @@ public class FunctionalitiesPanel extends JPanel {
}
}
});
portal = new JRadioButton(SAREF.getMessage("portal"));
portal.setToolTipText(SAREF.getMessage("portal_tooltip"));
portal.addActionListener(new ActionListener() {
prerelease_portal = new JRadioButton(SAREF.getMessage("prerelease_portal"));
prerelease_portal.setToolTipText(SAREF.getMessage("prerelease_portal_tooltip"));
prerelease_portal.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if(portal.isSelected()) {
mainFrame.setMode(Mode.PORTAL);
if(prerelease_portal.isSelected()) {
mainFrame.setMode(Mode.PRERELEASE_PORTAL);
}
}
});
release_portal = new JRadioButton(SAREF.getMessage("release_portal"));
release_portal.setToolTipText(SAREF.getMessage("release_portal_tooltip"));
release_portal.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if(release_portal.isSelected()) {
mainFrame.setMode(Mode.RELEASE_PORTAL);
}
}
});
ButtonGroup modeGroup = new ButtonGroup();
modeGroup.add(develop);
modeGroup.add(release);
modeGroup.add(portal);
modeGroup.add(prerelease_portal);
modeGroup.add(release_portal);
JPanel panel2 = new JPanel();
panel2.setLayout(new BoxLayout(panel2, BoxLayout.Y_AXIS));
panel2.add(new JLabel(SAREF.getMessage("modes")));
panel2.add(develop);
panel2.add(release);
panel2.add(portal);
panel2.add(prerelease_portal);
panel2.add(release_portal);
add(panel2);
ignoreSite = new JCheckBox(SAREF.getMessage("ignoreSite"), false);
......
......@@ -26,7 +26,6 @@
package fr.emse.gitlab.saref.managers;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Collection;
......@@ -39,10 +38,6 @@ import org.apache.jena.query.text.TextDatasetFactory;
import org.apache.jena.query.text.TextIndex;
import org.apache.jena.query.text.TextIndexConfig;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.rdf.model.Property;
import org.apache.jena.rdf.model.Resource;
import org.apache.jena.riot.Lang;
import org.apache.jena.tdb.TDBFactory;
import org.apache.jena.vocabulary.DCTerms;
import org.apache.jena.vocabulary.OWL;
......@@ -50,9 +45,7 @@ import org.apache.jena.vocabulary.OWL2;
import org.apache.jena.vocabulary.RDF;
import org.apache.jena.vocabulary.RDFS;
import org.apache.lucene.analysis.en.EnglishAnalyzer;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.store.SimpleFSDirectory;
import org.slf4j.Logger;
......
......@@ -122,7 +122,7 @@ public class OntologyManager extends SAREFErrorLogger {
try {
return ONTOLOGY_MANAGER.loadOntologyFromOntologyDocument(iri);
} catch (OWLOntologyCreationException ex) {
log(logger, getMessage(MESSAGE.loading_error), ex, Mode.DEVELOP, Mode.RELEASE, Mode.PORTAL);
log(logger, getMessage(MESSAGE.loading_error), ex, Mode.DEVELOP, Mode.RELEASE, Mode.PRERELEASE_PORTAL, Mode.RELEASE_PORTAL);
return null;
}
}
......@@ -136,7 +136,7 @@ public class OntologyManager extends SAREFErrorLogger {
try {
return ONTOLOGY_MANAGER.loadOntologyFromOntologyDocument(IRI.create(example.getIRI()));
} catch (OWLOntologyCreationException ex) {
log(logger, getMessage(MESSAGE.loading_error), ex, Mode.DEVELOP, Mode.RELEASE, Mode.PORTAL);
log(logger, getMessage(MESSAGE.loading_error), ex, Mode.DEVELOP, Mode.RELEASE, Mode.PRERELEASE_PORTAL, Mode.RELEASE_PORTAL);
return null;
}
}
......@@ -147,7 +147,7 @@ public class OntologyManager extends SAREFErrorLogger {
try {
return gen.getExplanations(axiomInconsistent, 10);
} catch (Exception ex) {
log(logger, getMessage(MESSAGE.reasoning_error), ex, Mode.DEVELOP, Mode.RELEASE, Mode.PORTAL);
log(logger, getMessage(MESSAGE.reasoning_error), ex, Mode.DEVELOP, Mode.RELEASE, Mode.PRERELEASE_PORTAL, Mode.RELEASE_PORTAL);
return null;
}
}
......
......@@ -100,8 +100,7 @@ public class RepositoryFactory extends SAREFErrorLogger {
log(msg, Mode.DEVELOP, Mode.RELEASE);
throw new SAREFPipelineException(msg);
} else {
log(getMessage(MESSAGE.source_name, SAREF.REGEX_NAME_PROJECT, name), Mode.DEVELOP, Mode.RELEASE,
Mode.PORTAL);
logError(getMessage(MESSAGE.source_name, SAREF.REGEX_NAME_PROJECT, name));
return null;
}
......@@ -135,7 +134,7 @@ public class RepositoryFactory extends SAREFErrorLogger {
if (!m.find()) {
if (isTarget && pipeline.mode == Mode.RELEASE) {
final String msg = String.format(getMessage(MESSAGE.release_branch, originalBranch));
errorLogger.warn(msg);
errorLogger.error(msg);
throw new SAREFPipelineException(msg);
}
originalVersionName = guessVersion(project, directory);
......@@ -205,6 +204,18 @@ public class RepositoryFactory extends SAREFErrorLogger {
for (Ref ref : allBranches) {
Matcher m = pattern.matcher(ref.getName());
if (m.find()) {
String branchType = m.group(REGEX_VERSION_BRANCH_VAR);
// only consider release branches when running in RELEASE_PORTAL mode
if(pipeline.mode == Mode.RELEASE_PORTAL && !branchType.equals("release")) {
continue;
}
// only consider prerelease and release branches when running in PRERELEASE_PORTAL mode
if(pipeline.mode == Mode.PRERELEASE_PORTAL && branchType.equals("develop")) {
continue;
}
int major = Integer.parseInt(m.group(SAREF.REGEX_VERSION_MAJOR_VAR));
int minor = Integer.parseInt(m.group(SAREF.REGEX_VERSION_MINOR_VAR));
int patch = Integer.parseInt(m.group(SAREF.REGEX_VERSION_PATCH_VAR));
......@@ -215,7 +226,7 @@ public class RepositoryFactory extends SAREFErrorLogger {
versionBuilder = new VersionBuilder(repository, versionName);
versionBuilders.put(versionName, versionBuilder);
}
switch (m.group(REGEX_VERSION_BRANCH_VAR)) {
switch (branchType) {
case "develop":
versionBuilder.developRef = ref;
break;
......
......@@ -42,7 +42,6 @@ import org.slf4j.Logger;
import fr.emse.gitlab.saref.SAREF;
import fr.emse.gitlab.saref.SAREFErrorLogger;
import fr.emse.gitlab.saref.SAREFPipeline;
import fr.emse.gitlab.saref.SAREFPipeline.Mode;
import fr.emse.gitlab.saref.SAREFPipelineException;
import fr.emse.gitlab.saref.entities.SAREFExample;
import fr.emse.gitlab.saref.entities.SAREFProject;
......@@ -99,8 +98,7 @@ public class RepositoryManager extends SAREFErrorLogger {
return;
}
SAREFVersion version = repository.getVersions().get(versionName);
boolean prereleaseOnly = pipeline.mode == Mode.RELEASE || pipeline.mode == Mode.PORTAL;
Ref ref = sourcesManager.getRef(version, prereleaseOnly);
Ref ref = sourcesManager.getRef(version);
if(ref == null) {
throw new SAREFPipelineException();
}
......@@ -111,7 +109,7 @@ public class RepositoryManager extends SAREFErrorLogger {
currentVersionName = versionName;
} catch (IOException | GitAPIException ex) {
String msg = getMessage(MESSAGE.checkout, repository.getProject().getName(), versionName);
log(msg, ex, Mode.DEVELOP, Mode.RELEASE, Mode.PORTAL);
logError(msg, ex);
throw new SAREFPipelineException(msg, ex);
}
}
......@@ -128,7 +126,7 @@ public class RepositoryManager extends SAREFErrorLogger {
git.checkout().setName(originalBranch).call();
} catch (IOException | GitAPIException ex) {
String msg = getMessage(MESSAGE.reset, originalBranch);
log(msg, ex, Mode.DEVELOP, Mode.RELEASE, Mode.PORTAL);
logError(msg, ex);
throw new SAREFPipelineException(msg, ex);
}
}
......@@ -154,7 +152,7 @@ public class RepositoryManager extends SAREFErrorLogger {
private void loadVersions(Git git, SAREFRepository repository) throws GitAPIException {
for (SAREFVersion version : repository.getVersions().values()) {
Ref ref = sourcesManager.getRef(version, false);
Ref ref = sourcesManager.getRef(version);
if(ref == null) {
continue;
}
......
......@@ -32,10 +32,9 @@ import java.io.IOException;
import java.io.StringWriter;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.jena.atlas.io.IndentedWriter;
import org.apache.jena.graph.NodeFactory;
......@@ -77,30 +76,27 @@ public class SiteManager extends SAREFErrorLogger {
private static final String EXAMPLE_QUERY = DOC_BASE + "example/main.rqg";
private static final Var VAR_EXAMPLE = VarUtils.allocVar("example");
private static final String NAME_STATIC = "static";
private static final String NAME_REPORT_HTML = "report.html";
private static final String HTACCESS_HTML = "RewriteCond %{HTTP_ACCEPT} !(application/rdf\\+xml|text/turtle|text/n3|application/n\\-triples|application/ld\\+json)";
private static final String HTACCESS_RDFXML = "RewriteCond %{HTTP_ACCEPT} application/rdf\\+xml";
private static final String HTACCESS_TURTLE = "RewriteCond %{HTTP_ACCEPT} text/turtle";
private static final String HTACCESS_N3 = "RewriteCond %{HTTP_ACCEPT} text/n3";
private static final String HTACCESS_NTRIPLE = "RewriteCond %{HTTP_ACCEPT} application/n-triples";
private static final String HTACCESS_JSONLD = "RewriteCond %{HTTP_ACCEPT} application/ld\\+json";
private static final String HTACCESS_PATH = "RewriteCond %{REQUEST_URI} ^(.*/)?[^/]*$\n";
private static final SPARQLExtStreamManager STREAM_MANAGER_BASE = StreamManagerFactory.get();
public final File siteDir;
public final File sourcesDir;
private final File reportFileHTML;
private final RootPlan planForTerm;
private final RootPlan planForOntologyVersion;
private final RootPlan planForExample;
private static enum MESSAGE {
prepare_error;
prepare_target_error, prepare_portal_error;
}
public SiteManager(SAREFPipeline pipeline, Logger errorLogger) throws IOException {
super(pipeline, errorLogger);
siteDir = new File(pipeline.targetDir, SAREF.NAME_SITE);
sourcesDir = new File(pipeline.targetDir, SAREF.NAME_SOURCES);
reportFileHTML = new File(siteDir, NAME_REPORT_HTML);
String query = IOUtils.toString(STREAM_MANAGER_BASE.open(new LookUpRequest(TERM_QUERY, SPARQLExt.MEDIA_TYPE)),
......@@ -120,12 +116,29 @@ public class SiteManager extends SAREFErrorLogger {
* Prepare the site folder and clone the saref-portal-static project repository.
*/
public void prepareSite() throws SAREFPipelineException {
try (Git git = Git.cloneRepository().setURI(SAREF.SAREF_PORTAL_STATIC_GIT).setDirectory(siteDir).call()) {
} catch (Exception ex) {
try (Git git = Git.open(siteDir)) {
git.pull().call();
if(pipeline.mode == Mode.DEVELOP || pipeline.mode == Mode.RELEASE) {
File portalSourcesDir = new File(sourcesDir, SAREF.NAME_SOURCES_PORTAL);
try (Git git = Git.cloneRepository().setURI(SAREF.SAREF_PORTAL_STATIC_GIT).setDirectory(portalSourcesDir).call()) {
File portal = new File(portalSourcesDir, SAREF.NAME_SOURCES_PORTAL);
FileUtils.copyDirectory(portal, siteDir);
} catch (Exception ex) {
try (Git git = Git.open(portalSourcesDir)) {
git.pull().call();
File portal = new File(portalSourcesDir, SAREF.NAME_SOURCES_PORTAL);
FileUtils.copyDirectory(portal, siteDir);
} catch (Exception e) {
String msg = getMessage(MESSAGE.prepare_target_error, SAREF.SAREF_PORTAL_STATIC_GIT);
logError(msg, e);
throw new SAREFPipelineException(msg, e);
}
}
} else {
try {
File portal = new File(pipeline.directory, SAREF.NAME_SOURCES_PORTAL);
FileUtils.copyDirectory(portal, siteDir);
} catch (Exception e) {
String msg = getMessage(MESSAGE.prepare_error, SAREF.SAREF_PORTAL_STATIC_GIT);
// should have a folder portal
String msg = getMessage(MESSAGE.prepare_target_error, SAREF.SAREF_PORTAL_STATIC_GIT);
logError(msg, e);
throw new SAREFPipelineException(msg, e);
}
......@@ -188,71 +201,50 @@ public class SiteManager extends SAREFErrorLogger {
public void generateHtaccess() {
File htaccess = new File(siteDir, ".htaccess");
try (FileWriter writer = new FileWriter(htaccess)) {
writer.write("RewriteEngine on\nDirectorySlash Off\n\n");
writer.write("nRewriteRule ^sources/(.*)$ https://forge.etsi.org/rep/SAREF/$1 [R=302,NE]\\n"); // redirect the sources
writer.write(HTACCESS_HTML);
writer.write("\nRewriteRule ^(.*)\\.conneg$ /$1.html\n");
writer.write(HTACCESS_JSONLD);
writer.write("\nRewriteRule ^(.*)\\.conneg$ /$1.jsonld\n");
writer.write(HTACCESS_N3);
writer.write("\nRewriteRule ^(.*)\\.conneg$ /$1.n3\n");
writer.write(HTACCESS_NTRIPLE);
writer.write("\nRewriteRule ^(.*)\\.conneg$ /$1.nt\n");
writer.write(HTACCESS_RDFXML);
writer.write("\nRewriteRule ^(.*)\\.conneg$ /$1.rdf\n");
writer.write(HTACCESS_TURTLE);
writer.write("\nRewriteRule ^(.*)\\.conneg$ /$1.ttl\n");
writer.write("\n");
for (RepositoryManager repositoryManager : pipeline.getSourcesManager().getSourceRepositoryManagers()) {
SAREFRepository repository = repositoryManager.getRepository();
SAREFProject project = repository.getProject();
SAREFVersion lastVersion = repository.getVersions().lastEntry().getValue();
writer.write("RewriteRule ^sources/(.*)$ https://forge.etsi.org/rep/SAREF/$1 [R=302]\n\n");
// redirects core to core/v3.1.1/
// redirects core/ to core/v3.1.1/
writer.write(String.format("RewriteRule ^%s/?$ /%s/ [R=302,NE]\n", project.getPath(), lastVersion.getVersionPath()));
// redirects core/Sensor to core/Sensor.conneg
String choiceOfTerms = repository.getTerms().values().stream().map(SAREFTerm::getLocalName)
.collect(Collectors.joining("|", "(", ")"));
writer.write(String.format("RewriteCond %%{REQUEST_URI} ^/%s/%s$\n", project.getPath(), choiceOfTerms));
writer.write(String.format("RewriteRule ^%s/(.*)$ /%s/$1.conneg\n\n", project.getPath(), project.getPath()));
writer.write(
"Header set Content-disposition \"expr=attachement; filename=%{resp:Content-Location}\" \"expr=%{resp:Content-Location} =~ /.(rdf|nt|n3)$/\"\n");
writer.write(
"Header set Content-disposition \"expr=inline; filename=%{resp:Content-Location}\" \"expr= %{resp:Content-Location} =~ /.+/ && !( %{resp:Content-Location} =~ /.(rdf|nt|n3)$/ )\"\n\n");
// redirects core.ttl to core/v1.1.1.ttl
writer.write(String.format("RewriteRule ^%s\\.([^\\./]+)$ /%s.$1 [R=302,NE]\n\n",
project.getPath(), lastVersion.getVersionPath()));
for (SAREFVersion version : repository.getVersions().values()) {
writer.write(String.format("RewriteRule ^%s/?$ /%s/%s.conneg\n",
version.getVersionPath(), version.getVersionPath(), project.getOntologyFileName()));
// redirects core/v1.1.1.ttl to core/v1.1.1/saref.ttl
writer.write(String.format("RewriteRule ^%s\\.([^\\./]+)$ /%s/%s.$1 [R=302,NE]\n",
version.getVersionPath(), version.getVersionPath(), project.getOntologyFileName()));
// redirects core/v1.1.1/saref to core/v1.1.1/saref.conneg
writer.write(String.format("RewriteRule ^%s/%s$ /%s/%s.conneg\n",
version.getVersionPath(), project.getOntologyFileName(), version.getVersionPath(),
project.getOntologyFileName()));
// redirects core/v1.1.1/tests to core/v1.1.1/tests.conneg
writer.write(String.format("RewriteRule ^%s/tests$ /%s/tests.conneg\n",
version.getVersionPath(), version.getVersionPath()));
// redirects core/v1.1.1/requirements to core/v1.1.1/requirements.conneg
writer.write(String.format("RewriteRule ^%s/requirements$ /%s/requirements.conneg\n",
version.getVersionPath(), version.getVersionPath()));
for (SAREFExample example : version.getExamples().values()) {
writer.write(String.format("RewriteRule ^%s/example/%s$ /%s/example/%s.conneg\n",
version.getVersionPath(), example.getName(), version.getVersionPath(),
example.getName()));
}
writer.write("\n\n");
}
if (pipeline.getSourcesManager().getTargetRepositoryManager() != null) {
writeHtaccess(writer, pipeline.getSourcesManager().getTargetRepositoryManager());
}
for (RepositoryManager repositoryManager : pipeline.getSourcesManager().getSourceRepositoryManagers()) {
writeHtaccess(writer, repositoryManager);
}
} catch (IOException ex) {
ex.printStackTrace();
}
}
private void writeHtaccess(FileWriter writer, RepositoryManager repositoryManager) throws IOException {
SAREFRepository repository = repositoryManager.getRepository();
SAREFProject project = repository.getProject();
if(repository.getVersions().isEmpty()) {
return;
}
SAREFVersion lastVersion = repository.getVersions().lastEntry().getValue();
// redirects core/ to core/v3.1.1/
writer.write(HTACCESS_PATH);
writer.write(
String.format("RewriteRule ^%s/$ %%1%s/ [R=302]\n", project.getPath(), lastVersion.getVersionName()));
// redirects core.ttl to core/v1.1.1.ttl
writer.write(HTACCESS_PATH);
writer.write(String.format("RewriteRule ^%s\\.([^\\./]+)$ %%1%s/%s.$1 [R=302]\n\n", project.getPath(),
lastVersion.getVersionPath(), project.getOntologyFileName()));
for (SAREFVersion version : repository.getVersions().values()) {
// redirects core/v3.1.1/ to core/v3.1.1/saref.conneg
writer.write(HTACCESS_PATH);
writer.write(String.format("RewriteRule ^%s/$ %%1%s\n", version.getVersionPath(),
project.getOntologyFileName()));
// redirects core/v1.1.1.ttl to core/v1.1.1/saref.ttl
writer.write(HTACCESS_PATH);
writer.write(String.format("RewriteRule ^%s\\.([^\\./]+)$ %%1%s/%s.$1 [R=302]\n", version.getVersionPath(),
version.getVersionName(), project.getOntologyFileName()));
writer.write("\n");
}
writer.write("\n");
}
}
......@@ -72,7 +72,6 @@ public class SourcesManager extends SAREFErrorLogger {
private static final Logger LOG = LoggerFactory.getLogger(SourcesManager.class);
private static final String CONFIGURATION_FILE_NAME = ".saref-repositories.yml";
private static final String NAME_SOURCES = "sources";
private static enum MESSAGE {
versions, yaml_error, yaml_repository, yaml_fetch, yaml_failure, reset_checkout_error, check_versions_error,
......@@ -86,11 +85,11 @@ public class SourcesManager extends SAREFErrorLogger {
public SourcesManager(SAREFPipeline pipeline, Logger errorLogger) {
super(pipeline, errorLogger);
this.sourcesDir = new File(pipeline.targetDir, NAME_SOURCES);
this.sourcesDir = new File(pipeline.targetDir, SAREF.NAME_SOURCES);
}
public void initTargetRepositoryManager() throws SAREFPipelineException {
if (pipeline.mode == Mode.PORTAL) {
if (pipeline.mode == Mode.PRERELEASE_PORTAL || pipeline.mode == Mode.RELEASE_PORTAL) {
targetRepositoryManager = null;
} else {
File directory = pipeline.directory;
......@@ -109,7 +108,7 @@ public class SourcesManager extends SAREFErrorLogger {
public void fetchRepositories() throws SAREFPipelineException {
final File confFile = new File(pipeline.directory, CONFIGURATION_FILE_NAME);
if (!confFile.exists()) {
if (pipeline.mode == Mode.PORTAL) {
if (pipeline.mode == Mode.PRERELEASE_PORTAL || pipeline.mode == Mode.RELEASE_PORTAL) {
logError(getMessage(MESSAGE.yaml_error, CONFIGURATION_FILE_NAME));
}
return;
......@@ -318,6 +317,7 @@ public class SourcesManager extends SAREFErrorLogger {
if (!pipeline.ignoreTerms) {
new TermSiteManager(pipeline, repository).generateSite();
}
siteManager.generateHtaccess();
} else {
// Mode is PORTAL. generate for every source
for (RepositoryManager repositoryManager : sourcesManagers.values()) {
......@@ -393,17 +393,20 @@ public class SourcesManager extends SAREFErrorLogger {
return sourcesManagers.get(project);
}
public Ref getRef(SAREFVersion version, boolean prereleaseOnly) {
public Ref getRef(SAREFVersion version) {
if(version == null) {
return null;
}
if(version.getReleaseRef() != null) {
return version.getReleaseRef();
}
if(pipeline.mode == Mode.RELEASE_PORTAL) {
return null;
}
if(version.getPrereleaseRef() != null) {
return version.getPrereleaseRef();
}
if(prereleaseOnly) {
if(pipeline.mode == Mode.PRERELEASE_PORTAL) {
return null;
}
return version.getDevelopRef();
......
......@@ -6,7 +6,8 @@ Runs the SAREF pipeline as specified in Technical Specification:
<mode> can take the following values:
develop Run the SAREF pipeline in relax mode in the target SAREF project
release Run the SAREF pipeline in strict mode in the target SAREF project
portal Run the SAREF pipeline in strict mode in all the SAREF projects listed in the `.saref-repositories.yml` file
prerelease-portal Operate a strict check and generate the portal for pre-release or release branches of each source in the configuration file `.saref-repositories.yml`
release-portal Operate a strict check generate the portal for release branches of each source in the configuration file `.saref-repositories.yml`
clean Remove all files generated by the previous executions
help Displays this message
......
......@@ -29,7 +29,7 @@ TEMPLATE <footer.rqg>( ?pathToStatic , ?isOntologyDocumentation ) {
<nav class="g-main-nav" role="navigation" data-g-hover-expand="true">
<ul class="g-toplevel">
<li class="g-menu-item g-menu-item-type-component g-menu-item-245 g-standard ">
<a class="g-menu-item-container" href="index.php/legal-matters">
<a class="g-menu-item-container" href="https://forge.etsi.org/index.php/legal-matters">
<span class="g-menu-item-content">
<span class="g-menu-item-title">Legal matters</span>
</span>
......
......@@ -44,7 +44,7 @@ TEMPLATE <head.rqg>( ?before, ?pathToStatic , ?isOntologyDocumentation ) {
</script>
<!--[if (gte IE 8)&(lte IE 9)]>
<script type="text/javascript" src="{ ?pathToStatic }/media/gantry5/assets/js/html5shiv-printshiv.min.js"></script>
<link rel="stylesheet" href="media/gantry5/engines/nucleus/css/nucleus-ie9.css" type="text/css"/>
<link rel="stylesheet" href="{ ?pathToStatic }/media/gantry5/engines/nucleus/css/nucleus-ie9.css" type="text/css"/>
<script type="text/javascript" src="{ ?pathToStatic }/media/gantry5/assets/js/matchmedia.polyfill.js"></script>
<![endif]-->
......@@ -68,7 +68,7 @@ TEMPLATE <head.rqg>( ?before, ?pathToStatic , ?isOntologyDocumentation ) {
<div class="g-grid">
<div class="g-block size-17">
<div class="g-content g-particle">
<a href="" title="" rel="home" class="g-logo g-logo-helium">
<a href="https://www.etsi.org/" title="" rel="home" class="g-logo g-logo-helium">
<img src="{ ?pathToStatic }/images/logo-l.png" alt="" />
</a>
</div>
......@@ -80,7 +80,7 @@ TEMPLATE <head.rqg>( ?before, ?pathToStatic , ?isOntologyDocumentation ) {
<li class="g-menu-item g-menu-item-type-component g-menu-item-217 active g-standard ">
<a class="g-menu-item-container" href="index.html">
<a class="g-menu-item-container" href="/index.html">
<span class="g-menu-item-content">
<span class="g-menu-item-title">Home</span>
</span>
......@@ -89,36 +89,28 @@ TEMPLATE <head.rqg>( ?before, ?pathToStatic , ?isOntologyDocumentation ) {
<li class="g-menu-item g-menu-item-type-component g-menu-item-242 g-standard ">
<a class="g-menu-item-container" href="core/">
<a class="g-menu-item-container" href="/core/">
<span class="g-menu-item-content">
<span class="g-menu-item-title">SAREF core</span>
</span>
</a>
</li>
<li class="g-menu-item g-menu-item-type-component g-menu-item-242 g-standard ">
<a class="g-menu-item-container" href="resources.html">
<a class="g-menu-item-container" href="/extensions.html">
<span class="g-menu-item-content">
<span class="g-menu-item-title">Resources</span>
<span class="g-menu-item-title">Extensions</span>
</span>
</a>
</li>
<li class="g-menu-item g-menu-item-type-component g-menu-item-242 g-standard ">
<a class="g-menu-item-container" href="https://forge.etsi.org/gitlab/SAREF/">
<a class="g-menu-item-container" href="/sources/">
<span class="g-menu-item-content">
<span class="g-menu-item-title">Participate</span>
</span>
</a>
</li>
<li class="g-menu-item g-menu-item-type-component g-menu-item-242 g-standard ">
<a class="g-menu-item-container" href="">
<span class="g-menu-item-content">
<span class="g-menu-item-title">About us</span>
</span>
</a>
</li>
<li class="g-menu-item g-menu-item-type-component g-menu-item-242 g-standard ">
<a class="g-menu-item-container" href="https://www.etsi.org/committee/smartm2m">
<span class="g-menu-item-content">
......
......@@ -10,4 +10,5 @@ log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
#log4j.appender.stdout.layout.ConversionPattern=## %-5p in %c%n%n%m%n%n
log4j.appender.stdout.layout.ConversionPattern=## %-5p in %c%n%n%m%nIn %C:%L:%M%n%n
log4j.appender.stdout.layout.ConversionPattern=## %p in %c%n%n%m%n%n
#In %C:%L:%M%n%n
......@@ -17,8 +17,10 @@ develop=develop
develop_tooltip=Check a SAREF project under development
release=release
release_tooltip=Operate a strict check on a SAREF project on branches develop-vx.y.z, prerelease-vx.y.z, or release-vx.y.z
portal=portal
portal_tooltip=Operate a strict check for each source reference in the configuration file .saref-repositories.yml
prerelease_portal=portal prerelease
prerelease_portal_tooltip=Operate a strict check and generate the portal for pre-release or release branches of each source in the configuration file .saref-repositories.yml
release_portal=portal release
release_portal_tooltip=Operate a strict check generate the portal for release branches of each source in the configuration file .saref-repositories.yml
modes=2. Select the execution mode
ignoreSite=do not generate the website
ignoreSite_tooltip=Only generates the report, not the HTML documentation
......
prepare_error=Failed to clone or pull site repository %s
\ No newline at end of file
prepare_target_error=Failed to clone or pull site repository %s
prepare_portal_error=When run in `prerelease-portal` or `release-portal` mode, the pipeline must be run in a directory that contains a directory named `portal`
\ No newline at end of file
<body class="gantry g-helium-style site com_content view-article no-layout no-task dir-ltr itemid-217 outline-19 g-offcanvas-left g-default g-style-preset1">
<div id="g-offcanvas" data-g-offcanvas-swipe="1" data-g-offcanvas-css3="1">
<div id="g-offcanvas" data-g-offcanvas-swipe="1" data-g-offcanvas-css3="1">