From 73f847f9ef7dd7ae06b39a4a75540fed39392d5c Mon Sep 17 00:00:00 2001 From: Joe Robinson Date: Thu, 10 Dec 2015 23:41:12 +0000 Subject: Assign properties to variables to debug --- .../java/uk/co/blatech/blaears/controllers/GitMergeController.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 09c7134..e8d521a 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,13 @@ 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"); -- cgit v1.2.3