summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/uk/co/blatech/blaears/controllers/GitMergeController.java2
-rw-r--r--src/main/java/uk/co/blatech/blaears/models/gitlab/ObjectAttributes.java6
-rw-r--r--src/main/java/uk/co/blatech/blaears/models/gitlab/User.java11
3 files changed, 12 insertions, 7 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 09c7134..941633b 100644
--- a/src/main/java/uk/co/blatech/blaears/controllers/GitMergeController.java
+++ b/src/main/java/uk/co/blatech/blaears/controllers/GitMergeController.java
@@ -32,7 +32,7 @@ public class GitMergeController {
// return "gitlab";
}
//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 " + 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");
diff --git a/src/main/java/uk/co/blatech/blaears/models/gitlab/ObjectAttributes.java b/src/main/java/uk/co/blatech/blaears/models/gitlab/ObjectAttributes.java
index 8c679d7..63bc758 100644
--- a/src/main/java/uk/co/blatech/blaears/models/gitlab/ObjectAttributes.java
+++ b/src/main/java/uk/co/blatech/blaears/models/gitlab/ObjectAttributes.java
@@ -1,5 +1,7 @@
package uk.co.blatech.blaears.models.gitlab;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
/**
* Model for a GitLab object_attribute which is used in various hook messages, to be converted from JSON
* See http://www.blatech.co.uk/help/web_hooks/web_hooks
@@ -7,7 +9,11 @@ package uk.co.blatech.blaears.models.gitlab;
public class ObjectAttributes {
int id;
+
+ @JsonProperty("target_branch")
String targetBranch;
+
+ @JsonProperty("source_branch")
String sourceBranch;
String title;
diff --git a/src/main/java/uk/co/blatech/blaears/models/gitlab/User.java b/src/main/java/uk/co/blatech/blaears/models/gitlab/User.java
index 8403d83..4196e76 100644
--- a/src/main/java/uk/co/blatech/blaears/models/gitlab/User.java
+++ b/src/main/java/uk/co/blatech/blaears/models/gitlab/User.java
@@ -8,8 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
public class User {
String name;
- @JsonProperty("user_name")
- String userName;
+ String username;
public String getName() {
return name;
@@ -19,11 +18,11 @@ public class User {
this.name = name;
}
- public String getUserName() {
- return userName;
+ public String getUsername() {
+ return username;
}
- public void setUserName(String userName) {
- this.userName = userName;
+ public void setUserNnme(String username) {
+ this.username = username;
}
}