diff options
-rw-r--r-- | src/main/java/uk/co/blatech/blaears/controllers/GitMergeController.java | 8 |
1 files changed, 7 insertions, 1 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 941633b..8752401 100644 --- a/src/main/java/uk/co/blatech/blaears/controllers/GitMergeController.java +++ b/src/main/java/uk/co/blatech/blaears/controllers/GitMergeController.java @@ -31,8 +31,14 @@ public class GitMergeController { action = " did a " + mergeMsg.getObjectKind() + " from "; // return "gitlab"; } + + String user = mergeMsg.getUser().getUsername(); + String source = mergeMsg.getObjectAttributes().getSourceBranch(); + String target = mergeMsg.getObjectAttributes().getTargetBranch(); + String url = mergeMsg.getUrl(); //DANGER - 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 "}); + Runtime.getRuntime().exec(new String[]{"/bin/bash", "-c", "echo theblueroom " + user + action + source + " to " + target + ": " + url + " | bash /home/smsd/msgrelay.bash "}); + model.addAttribute("result", "OK"); } catch (IOException e) { System.out.println("Failed to run command"); |