Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ExampleProject
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Coscine
backend
scripts
ExampleProject
Commits
fc593bb2
Commit
fc593bb2
authored
5 years ago
by
L. Ellenbeck
Browse files
Options
Downloads
Patches
Plain Diff
Working variation
parent
1e0b0ec6
No related branches found
No related tags found
1 merge request
!21
Topic/570 git version
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
build.cake
+17
-7
17 additions, 7 deletions
build.cake
with
17 additions
and
7 deletions
build.cake
+
17
−
7
View file @
fc593bb2
...
@@ -138,7 +138,7 @@ Task("GitlabRelease")
...
@@ -138,7 +138,7 @@ Task("GitlabRelease")
var tagList = result.Content.ReadAsStringAsync().Result;
var tagList = result.Content.ReadAsStringAsync().Result;
var jArray = JArray.Parse(tagList);
var jArray = JArray.Parse(tagList);
// null if not tags exists yet
// null if not tags exists yet
var lastTag = jArray.FirstOrDefault();
var lastTag = jArray.
Select(x => x["name"]).
FirstOrDefault();
var url = $"https://git.rwth-aachen.de/{gitlabProjectPath}";
var url = $"https://git.rwth-aachen.de/{gitlabProjectPath}";
...
@@ -165,12 +165,14 @@ Task("GitlabRelease")
...
@@ -165,12 +165,14 @@ Task("GitlabRelease")
logParam = $"{lastTag}..Head";
logParam = $"{lastTag}..Head";
}
}
Information(lastTag);
IEnumerable<string> redirectedStandardOutput;
IEnumerable<string> redirectedStandardOutput;
var exitCodeWithArgument =
var exitCodeWithArgument =
StartProcess(
StartProcess(
"git",
"git",
new ProcessSettings {
new ProcessSettings {
Arguments = $"log {logParam} --pretty=format:
'
%h
%B
'
",
Arguments = $"log {logParam} --pretty=format:
HASH
%h
:
%B",
RedirectStandardOutput = true
RedirectStandardOutput = true
},
},
out redirectedStandardOutput
out redirectedStandardOutput
...
@@ -187,14 +189,22 @@ Task("GitlabRelease")
...
@@ -187,14 +189,22 @@ Task("GitlabRelease")
{"Chore", new List<string>()},
{"Chore", new List<string>()},
};
};
var currentHash = "";
// Output last line of process output.
// Output last line of process output.
foreach(var line in redirectedStandardOutput) {
foreach(var line in redirectedStandardOutput) {
var index = line.IndexOf(" ");
var commitMessage = "";
var commitHash = line.Substring(0, index);
if(line.StartsWith("HASH")) {
var commitMessage = line.Substring(index + 1);
currentHash = line.Substring("HASH".Length);
currentHash = currentHash.Substring(0, currentHash.IndexOf(":"));
commitMessage = line.Substring(currentHash.Length + line.IndexOf(currentHash) + 1);
} else {
commitMessage = line;
}
foreach(var kv in prefixList) {
foreach(var kv in prefixList) {
if(commitMessage.StartsWith($"{kv.Key}:")) {
if(commitMessage.StartsWith($"{kv.Key}:")) {
kv.Value.Add($"* {commitMessage.Substring(kv.Key.Length + 1).Trim()} {commitHash}");
kv.Value.Add($"* {commitMessage.Substring(kv.Key.Length + 1).Trim()} {currentHash}");
break;
}
}
};
};
}
}
...
@@ -210,7 +220,7 @@ Task("GitlabRelease")
...
@@ -210,7 +220,7 @@ Task("GitlabRelease")
}
}
// correctly escape the json newlines
// correctly escape the json newlines
description = description.Replace("\n", "\\n");
description = description.Replace("\n", "\\n");
Information("{0}", description);
Information("
Description:
{0}", description);
throw new Exception();
throw new Exception();
// create tag
// create tag
...
...
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