From 887b25535ae9d7c2d7a0ba34fbbffed63208e6fd Mon Sep 17 00:00:00 2001 From: Joe Robinson Date: Thu, 10 Dec 2015 23:22:13 +0000 Subject: Update readme --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index b8e56c8..c2bb9a0 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,17 @@ BlaEars ======= It's called BlaEars because it listens for HTTP requests. Get it? + +This is used for listening for HTTP requests on specified URLs, and then +doing something with them - specifically, sending messages to IRC (at +the moment) + +Current supported URLs - + +/git/push +Listens for GitLab messages announcing pushes to repositories + +/git/merge +Listens for GitLab messages announcing merge requests + +Uses Spring MVC and SpringBoot -- cgit v1.2.3 From b8bf8d6b49f1c220095f2768fcfa6d48264d9b42 Mon Sep 17 00:00:00 2001 From: Joe Robinson Date: Thu, 10 Dec 2015 23:27:59 +0000 Subject: Fix commit message output --- src/main/java/uk/co/blatech/blaears/controllers/GitPushController.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/uk/co/blatech/blaears/controllers/GitPushController.java b/src/main/java/uk/co/blatech/blaears/controllers/GitPushController.java index 85592c8..2e8020b 100644 --- a/src/main/java/uk/co/blatech/blaears/controllers/GitPushController.java +++ b/src/main/java/uk/co/blatech/blaears/controllers/GitPushController.java @@ -26,6 +26,7 @@ public class GitPushController { if (StringUtils.isNotEmpty(commitMsg)) { commitMsg += ", "; } + commitMsg += commit.getMessage(); } //DANGER Runtime.getRuntime().exec(new String[]{"/bin/bash", "-c", "echo theblueroom " + pushMsg.getUserName() + " pushed to " + pushMsg.getRepository().getName() + ": "+ commitMsg + " | bash /home/smsd/msgrelay.bash "}); -- cgit v1.2.3 From de928d15cdfc50d5165b2dc393b015ccf0b97735 Mon Sep 17 00:00:00 2001 From: Joe Robinson Date: Thu, 10 Dec 2015 23:28:17 +0000 Subject: Add catch-all action for debugging --- .../java/uk/co/blatech/blaears/controllers/GitMergeController.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/uk/co/blatech/blaears/controllers/GitMergeController.java b/src/main/java/uk/co/blatech/blaears/controllers/GitMergeController.java index 5622aea..09c7134 100644 --- a/src/main/java/uk/co/blatech/blaears/controllers/GitMergeController.java +++ b/src/main/java/uk/co/blatech/blaears/controllers/GitMergeController.java @@ -28,10 +28,11 @@ public class GitMergeController { } else if (mergeMsg.getObjectKind().equals("merge")) { action = " merged from branch "; } else { - return "gitlab"; + action = " did a " + mergeMsg.getObjectKind() + " from "; +// return "gitlab"; } //DANGER - Runtime.getRuntime().exec(new String[]{"/bin/bash", "-c", "echo theblueroom " + mergeMsg.getUser().getUserName()+ " created a merge request from " + mergeMsg.getObjectAttributes().getSourceBranch() + " to " + mergeMsg.getObjectAttributes().getTargetBranch() + ": " + mergeMsg.getUrl() + " | bash /home/smsd/msgrelay.bash "}); + Runtime.getRuntime().exec(new String[]{"/bin/bash", "-c", "echo theblueroom " + mergeMsg.getUser().getUserName() + action + mergeMsg.getObjectAttributes().getSourceBranch() + " to " + mergeMsg.getObjectAttributes().getTargetBranch() + ": " + mergeMsg.getUrl() + " | bash /home/smsd/msgrelay.bash "}); model.addAttribute("result", "OK"); } catch (IOException e) { System.out.println("Failed to run command"); -- cgit v1.2.3