Skip to content
Snippets Groups Projects
Commit 44bbb1bf authored by L. Ellenbeck's avatar L. Ellenbeck
Browse files

Merge branch 'Topic/570-gitVersion' into 'master'

Topic/570 git version

See merge request coscine/cs/exampleproject!12
parents f897c804 db4792a2
Branches
Tags v1.5.4
1 merge request!12Topic/570 git version
...@@ -220,28 +220,7 @@ IEnumerable<string> redirectedStandardOutput; ...@@ -220,28 +220,7 @@ IEnumerable<string> redirectedStandardOutput;
description += "\n"; description += "\n";
} }
} }
// create tag
/*exitCodeWithArgument =
StartProcess(
"git",
new ProcessSettings {
Arguments = $"tag v{semanticVersion}",
RedirectStandardOutput = true
},
out redirectedStandardOutput
);
exitCodeWithArgument =
StartProcess(
"git",
new ProcessSettings {
Arguments = $"push \"https://gitlab-ci-token:{gitlabToken}@git.rwth-aachen.de/{gitlabProjectPath}.git\" HEAD:master --tags",
RedirectStandardOutput = true
},
out redirectedStandardOutput
);*/
var settings = new HttpSettings var settings = new HttpSettings
{ {
Headers = new Dictionary<string, string> Headers = new Dictionary<string, string>
...@@ -251,16 +230,24 @@ IEnumerable<string> redirectedStandardOutput; ...@@ -251,16 +230,24 @@ IEnumerable<string> redirectedStandardOutput;
EnsureSuccessStatusCode = true, EnsureSuccessStatusCode = true,
}; };
// create tag
settings.SetJsonRequestBody("{}"); settings.SetJsonRequestBody("{}");
var responseBody = HttpPost($"https://git.rwth-aachen.de/api/v4/projects/{gitlabProjectId}/repository/tags?tag_name=v{semanticVersion}&ref=master&release_description={description}", settings); var responseBody = HttpPost($"https://git.rwth-aachen.de/api/v4/projects/{gitlabProjectId}/repository/tags?tag_name=v{semanticVersion}&ref=master&release_description={description}", settings);
Information(responseBody); Information("Create tag: {0}", responseBody);
// create release // create release
settings = new HttpSettings
{
Headers = new Dictionary<string, string>
{
{"PRIVATE-TOKEN", gitlabToken},
},
EnsureSuccessStatusCode = true,
};
var json = $"{{\"name\": \"v{semanticVersion}\", \"tag_name\": \"v{semanticVersion}\" \"description\": \"{description}\"}}"; var json = $"{{\"name\": \"v{semanticVersion}\", \"tag_name\": \"v{semanticVersion}\" \"description\": \"{description}\"}}";
settings.SetJsonRequestBody(json); settings.SetJsonRequestBody(json);
responseBody = HttpPost($"https://git.rwth-aachen.de/api/v4/projects/{gitlabProjectId}/releases", settings); responseBody = HttpPost($"https://git.rwth-aachen.de/api/v4/projects/{gitlabProjectId}/releases", settings);
Information(responseBody); Information("Create release: {0}", responseBody);
}); });
Task("Build") Task("Build")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment