Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
saref-pipeline
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SAREF
saref-pipeline
Commits
db8a0462
Commit
db8a0462
authored
5 years ago
by
Maxime Lefrançois
Browse files
Options
Downloads
Patches
Plain Diff
attempt to use CI branch env variable
to avoid errors like
https://gitlab.emse.fr/saref/repo/saref-core/-/jobs/6593
parent
d8058475
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/fr/emse/gitlab/saref/managers/RepositoryFactory.java
+7
-2
7 additions, 2 deletions
...java/fr/emse/gitlab/saref/managers/RepositoryFactory.java
with
7 additions
and
2 deletions
src/main/java/fr/emse/gitlab/saref/managers/RepositoryFactory.java
+
7
−
2
View file @
db8a0462
...
@@ -117,11 +117,16 @@ public class RepositoryFactory extends SAREFErrorLogger {
...
@@ -117,11 +117,16 @@ public class RepositoryFactory extends SAREFErrorLogger {
errorLogger
.
warn
(
msg
);
errorLogger
.
warn
(
msg
);
}
}
String
originalBranch
=
git
.
getRepository
().
getBranch
();
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"
);
originalBranch
=
System
.
getProperty
(
"CI_COMMIT_REF_NAME"
);
System
.
out
.
println
(
"CI_COMMIT_REF_NAME is set to "
+
originalBranch
);
System
.
out
.
println
(
"CI_COMMIT_REF_NAME is set to "
+
originalBranch
);
}
}
final
SAREFVersionName
originalVersion
;
final
SAREFVersionName
originalVersion
;
Pattern
pattern
=
Pattern
.
compile
(
REGEX_VERSION_BRANCH
);
Pattern
pattern
=
Pattern
.
compile
(
REGEX_VERSION_BRANCH
);
Matcher
m
=
pattern
.
matcher
(
originalBranch
);
Matcher
m
=
pattern
.
matcher
(
originalBranch
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment