Commit 399e2c69 authored by 黎博's avatar 黎博

优化

parent 6f96e84b
......@@ -32,10 +32,14 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineMapper, Pipeline> i
@Override
public void buildPipelineJob(String gitlabData) {
String projectName = JsonPath.read(gitlabData, "$.project.name");
String branch = JsonPath.read(gitlabData, "$.project.default_branch");
String message = JsonPath.read(gitlabData, "$.commits[0].message");
String branch = JsonPath.read(gitlabData, "$.ref").toString().split("/")[2];
Integer totalCommitCount = JsonPath.read(gitlabData, "$.total_commits_count");
if (totalCommitCount.equals(0)) {
return;
}
String message = JsonPath.read(gitlabData, "$.commits[-1].message");
String author = JsonPath.read(gitlabData, "$.user_username");
String commitDate = JsonPath.read(gitlabData, "$.commits[0].timestamp");
String commitDate = JsonPath.read(gitlabData, "$.commits[-1].timestamp");
QueryWrapper<Pipeline> pipelineQueryWrapper = new QueryWrapper<>();
pipelineQueryWrapper.eq("service_name", projectName);
pipelineQueryWrapper.eq("service_branch", branch);
......
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