Skip to content

Commit

Permalink
feat: add correct continous integration tool name for the pull reques…
Browse files Browse the repository at this point in the history
…t and commit

This corrects the name of the continous integration tool for the bot generated pull request and commit.

Resolves jhipster#272
  • Loading branch information
SudharakaP committed Jan 12, 2021
1 parent 222550c commit 942cd4e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void configureCiCd(
this.jHipsterService.addCiCd(ciCdId, workingDir, ciCdTool);

this.gitService.addAllFilesToRepository(git, workingDir);
this.gitService.commit(git, workingDir, "Configure " + ciCdTool.capitalize() + " Continuous Integration");
this.gitService.commit(git, workingDir, "Configure " + ciCdTool.getCiCdToolName() + " Continuous Integration");

this.logsService.addLog(
ciCdId,
Expand All @@ -107,7 +107,7 @@ public void configureCiCd(
this.logsService.addLog(ciCdId, "Application successfully pushed!");
this.logsService.addLog(ciCdId, "Creating " + (isGitHub ? "Pull" : "Merge") + " Request");

String pullRequestTitle = "Configure Continuous Integration with " + ciCdTool.capitalize();
String pullRequestTitle = "Configure Continuous Integration with " + ciCdTool.getCiCdToolName();
String pullRequestBody = "Continuous Integration configured by JHipster";

if (isGitHub) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ public String branchName(String complement) {
return format("{0}-{1}-{2}", "jhipster", name().toLowerCase(), complement);
}

public String capitalize() {
return StringUtils.capitalize(name().toLowerCase());
public String getCiCdToolName() {
if (name().equals("GITLAB")) {
return "GitLab";
} else if (name().equals("GITHUB")) {
return "GitHub";
} else {
return StringUtils.capitalize(name().toLowerCase());
}
}
}

0 comments on commit 942cd4e

Please sign in to comment.