Commit 68cc26cc authored by Maxime Lefrançois's avatar Maxime Lefrançois
parent aedcc7f1
......@@ -170,6 +170,7 @@ public class CLIExecution implements SAREFCredentialsProvider {
if (console != null) {
return console.readPassword(SAREF.getMessage(MESSAGE.account_password.toString(), hostName));
} else if (System.getenv("GITLAB_CI") != null) {
LOG.info("using password environment variable GITLAB_CI");
return System.getenv("CI_JOB_TOKEN").toCharArray();
} else {
LOG.warn(SAREF.getMessage(MESSAGE.account_password_empty.toString(), hostName));
......
......@@ -64,7 +64,7 @@ public class SAREF {
public static final String SAREF_PORTAL_STATIC_GIT = "https://gitlab.emse.fr/saref/saref-portal-static.git";
// public static final String SAREF_PORTAL_STATIC_GIT = "https://forge.etsi.org/rep/SAREF/saref-portal-static.git"; // uncomment when the project is public
public static final String LOGGER_BASE = "saref.pipeline";
public static final String LOGGER_BASE = "SAREF Pipeline: ";
public static final String NAME_SITE = "site";
......
......@@ -92,6 +92,7 @@ public class RepositoryFactory extends SAREFErrorLogger {
final SAREFProject project;
final String name = directory.getName();
LOG.trace("name " + name);
final Matcher matcher = PATTERN.matcher(name);
if (!matcher.find()) {
if (isTarget) {
......@@ -106,6 +107,7 @@ public class RepositoryFactory extends SAREFErrorLogger {
}
}
final String acronym = matcher.group(SAREF.REGEX_ACRONYM_VAR);
LOG.trace("acronym " + acronym);
if (acronym == null) {
project = SAREFCore.INSTANCE;
} else {
......@@ -114,15 +116,17 @@ public class RepositoryFactory extends SAREFErrorLogger {
try (Git git = Git.open(directory)) {
final boolean isClean = git.status().call().isClean();
LOG.trace("isClean " + isClean);
if (!isClean) {
final String msg = getMessage(MESSAGE.not_clean, project.getName());
errorLogger.warn(msg);
}
String originalBranch = git.getRepository().getBranch();
LOG.trace("originalBranch " + originalBranch);
if (isTarget && System.getenv("CI_COMMIT_REF_NAME") != null) {
originalBranch = System.getenv("CI_COMMIT_REF_NAME");
System.out.println("CI_COMMIT_REF_NAME is set to " + originalBranch);
LOG.trace("CI_COMMIT_REF_NAME is set to " + originalBranch);
}
final SAREFVersionName originalVersionName;
......@@ -148,6 +152,8 @@ public class RepositoryFactory extends SAREFErrorLogger {
int patch = Integer.parseInt(m.group(SAREF.REGEX_VERSION_PATCH_VAR));
originalVersionName = new SAREFVersionName(major, minor, patch);
}
LOG.trace("originalVersionName " + originalVersionName);
SAREFRepository repository = new SAREFRepository(directory, project, isClean, originalVersionName,
originalBranch);
if(isTarget) {
......
log4j.rootLogger=WARN, stdout
log4j.logger.com.jayway.jsonpath.internal.path=OFF
log4j.logger.fr.emse.gitlab=DEBUG
log4j.logger.fr.emse.gitlab=TRACE
log4j.logger.saref.pipeline=DEBUG
#log4j.logger.fr.emse.ci.sparqlext=TRACE
log4j.logger.SAREF=WARN
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=%l - %-5p - %c - %m%n
log4j.appender.stdout.layout.ConversionPattern=## %-5p in %c%n%n%m%n%n
......@@ -2,9 +2,9 @@ start=SAREF Pipeline execution in %s
clause=%s %s - Issues in TS 103 673 Clause %s
clause_for=%s %s for %s - Issues in TS 103 673 Clause %s
loading=Loading %s
account_name=Please enter your account username for %s
account_name=Please enter your account username for %s (optional for public repositories)
account_name_empty=using empty username
account_password=Please enter your account password for %s
account_password=Please enter your account password for %s (optional for public repositories)
account_password_empty=using empty password
open_report=The report has been generated at %s Would you like to open it?
open_doc=The report has been generated at %s Would you like to open it?
......
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