-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Payload json now in pojo and used in cause
- Loading branch information
Showing
7 changed files
with
177 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/main/java/org/jenkinsci/plugins/gogs/GogsEnvironmentContributor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package org.jenkinsci.plugins.gogs; | ||
|
||
import hudson.EnvVars; | ||
import hudson.Extension; | ||
import hudson.model.Run; | ||
import hudson.model.TaskListener; | ||
import jenkins.model.CoreEnvironmentContributor; | ||
|
||
import javax.annotation.Nonnull; | ||
import java.io.IOException; | ||
|
||
@Extension | ||
public class GogsEnvironmentContributor extends CoreEnvironmentContributor { | ||
@Override | ||
public void buildEnvironmentFor(@Nonnull Run r, @Nonnull EnvVars envs, @Nonnull TaskListener listener) | ||
throws IOException, InterruptedException { | ||
GogsCause gogsCause; | ||
|
||
gogsCause = (GogsCause) r.getCause(GogsCause.class); | ||
if (gogsCause != null) { | ||
envs.putAll(gogsCause.getEnvVars()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
src/main/java/org/jenkinsci/plugins/gogs/GogsPayloadData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package org.jenkinsci.plugins.gogs; | ||
|
||
import java.util.List; | ||
|
||
public class GogsPayloadData { | ||
public static class UserDetails { | ||
public String name; | ||
public String email; | ||
public String username; | ||
} | ||
|
||
public static class Owner { | ||
public Long id; | ||
public String login; | ||
public String full_name; | ||
public String email; | ||
public String avatar_url; | ||
public String username; | ||
} | ||
|
||
public static class Commits { | ||
public String id; | ||
public String message; | ||
public String url; | ||
public UserDetails author; | ||
public UserDetails committer; | ||
public List<String> added; | ||
public List<String> removed; | ||
public List<String> modified; | ||
public String timestamp; | ||
} | ||
|
||
public static class Repository { | ||
public Long id; | ||
public Owner owner; | ||
public String name; | ||
public String full_name; | ||
public String description; | ||
public Boolean Private; | ||
public Boolean fork; | ||
public Boolean parent; | ||
public Boolean empty; | ||
public Boolean mirror; | ||
public Long size; | ||
public String html_url; | ||
public String ssh_url; | ||
public String clone_url; | ||
public String website; | ||
public Long stars_count; | ||
public Long forks_count; | ||
public Long watchers_count; | ||
public Long open_issues_count; | ||
public String default_branch; | ||
public String created_at; | ||
public String updated_at; | ||
} | ||
|
||
public String ref; | ||
public String before; | ||
public String after; | ||
public String compare_url; | ||
public List<Commits> commits; | ||
public Repository repository; | ||
public Owner pusher; | ||
public Owner sender; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters