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

attempt to use CI branch env variable

parent d8058475
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -118,10 +118,15 @@ public class RepositoryFactory extends SAREFErrorLogger {
			}
			String originalBranch = git.getRepository().getBranch();

			if(System.getProperty("CI_COMMIT_REF_NAME") != null) {
			System.out.println("CI_COMMIT_REF_NAME is set to " + System.getenv("CI_COMMIT_REF_NAME"));

			System.out.println("CI_COMMIT_REF_NAME is set to " + System.getProperty("CI_COMMIT_REF_NAME"));

			if(isTarget && System.getProperty("CI_COMMIT_REF_NAME") != null) {
				originalBranch = System.getProperty("CI_COMMIT_REF_NAME");
				System.out.println("CI_COMMIT_REF_NAME is set to " + originalBranch);
			}
			
			final SAREFVersionName originalVersion;
			Pattern pattern = Pattern.compile(REGEX_VERSION_BRANCH);
			Matcher m = pattern.matcher(originalBranch);