Skip to content

Commit

Permalink
Remove GITLAB_COMMIT_* environment variables. (#216)
Browse files Browse the repository at this point in the history
Co-authored-by: Barney Gale <[email protected]>
  • Loading branch information
barneygale and barneygale authored Jun 30, 2022
1 parent bcc7660 commit 04cac57
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 38 deletions.
16 changes: 0 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -550,22 +550,6 @@ GITLAB_REPO_HOMEPAGE
GITLAB_REPO_GIT_SSH_URL
GITLAB_REPO_GIT_HTTP_URL
GITLAB_REPO_VISIBILITY_LEVEL
GITLAB_COMMIT_COUNT
GITLAB_COMMIT_ID_#
GITLAB_COMMIT_MESSAGE_#
GITLAB_COMMIT_TIMESTAMP_#
GITLAB_COMMIT_URL_#
GITLAB_COMMIT_AUTHOR_AVATAR_URL_#
GITLAB_COMMIT_AUTHOR_CREATED_AT_#
GITLAB_COMMIT_AUTHOR_EMAIL_#
GITLAB_COMMIT_AUTHOR_ID_#
GITLAB_COMMIT_AUTHOR_NAME_#
GITLAB_COMMIT_AUTHOR_STATE_#
GITLAB_COMMIT_AUTHOR_USERNAME_#
GITLAB_COMMIT_AUTHOR_WEB_URL_#
GITLAB_COMMIT_ADDED_#
GITLAB_COMMIT_MODIFIED_#
GITLAB_COMMIT_REMOVED_#
GITLAB_REQUEST_URL
GITLAB_REQUEST_STRING
GITLAB_REQUEST_TOKEN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;

import static io.jenkins.plugins.gitlabbranchsource.Cause.GitLabCauseUtils.defaultDateString;
import static io.jenkins.plugins.gitlabbranchsource.Cause.GitLabCauseUtils.defaultIntString;
import static io.jenkins.plugins.gitlabbranchsource.Cause.GitLabCauseUtils.defaultListSize;
import static io.jenkins.plugins.gitlabbranchsource.Cause.GitLabCauseUtils.defaultLongString;
import static io.jenkins.plugins.gitlabbranchsource.Cause.GitLabCauseUtils.defaultVisibilityString;
import static org.apache.commons.lang.StringUtils.defaultString;
Expand Down Expand Up @@ -51,25 +48,6 @@ public GitLabPushCauseData(PushEvent pushEvent) {
this.variables.put("GITLAB_REPO_GIT_SSH_URL", defaultString(pushEvent.getRepository().getGit_ssh_url()));
this.variables.put("GITLAB_REPO_GIT_HTTP_URL", defaultString(pushEvent.getRepository().getGit_http_url()));
this.variables.put("GITLAB_REPO_VISIBILITY_LEVEL", defaultVisibilityString(pushEvent.getRepository().getVisibility_level()));
this.variables.put("GITLAB_COMMIT_COUNT", defaultIntString(pushEvent.getTotalCommitsCount()));
int totalCommitsCount = defaultListSize(pushEvent.getCommits());
for(int index = 0; index < totalCommitsCount; index++) {
this.variables.put("GITLAB_COMMIT_ID_" + index+1, defaultString(pushEvent.getCommits().get(index).getId()));
this.variables.put("GITLAB_COMMIT_MESSAGE_" + index+1, defaultString(pushEvent.getCommits().get(index).getMessage()));
this.variables.put("GITLAB_COMMIT_TIMESTAMP_" + index+1, defaultDateString(pushEvent.getCommits().get(index).getTimestamp()));
this.variables.put("GITLAB_COMMIT_URL_" + index+1, defaultString(pushEvent.getCommits().get(index).getUrl()));
this.variables.put("GITLAB_COMMIT_AUTHOR_AVATAR_URL_" + index+1, defaultString(pushEvent.getCommits().get(index).getAuthor().getAvatarUrl()));
this.variables.put("GITLAB_COMMIT_AUTHOR_CREATED_AT_" + index+1, defaultDateString(pushEvent.getCommits().get(index).getAuthor().getCreatedAt()));
this.variables.put("GITLAB_COMMIT_AUTHOR_EMAIL_" + index+1, defaultString(pushEvent.getCommits().get(index).getAuthor().getEmail()));
this.variables.put("GITLAB_COMMIT_AUTHOR_ID_" + index+1, defaultLongString(pushEvent.getCommits().get(index).getAuthor().getId()));
this.variables.put("GITLAB_COMMIT_AUTHOR_NAME_" + index+1, defaultString(pushEvent.getCommits().get(index).getAuthor().getName()));
this.variables.put("GITLAB_COMMIT_AUTHOR_STATE_" + index+1, defaultString(pushEvent.getCommits().get(index).getAuthor().getState()));
this.variables.put("GITLAB_COMMIT_AUTHOR_USERNAME_" + index+1, defaultString(pushEvent.getCommits().get(index).getAuthor().getUsername()));
this.variables.put("GITLAB_COMMIT_AUTHOR_WEB_URL_" + index+1, defaultString(pushEvent.getCommits().get(index).getAuthor().getWebUrl()));
this.variables.put("GITLAB_COMMIT_ADDED_" + index+1, String.join(", ", pushEvent.getCommits().get(index).getAdded()));
this.variables.put("GITLAB_COMMIT_MODIFIED_" + index+1, String.join(", ", pushEvent.getCommits().get(index).getModified()));
this.variables.put("GITLAB_COMMIT_REMOVED_" + index+1, String.join(", ", pushEvent.getCommits().get(index).getRemoved()));
}
this.variables.put("GITLAB_REQUEST_URL", defaultString(pushEvent.getRequestUrl()));
this.variables.put("GITLAB_REQUEST_STRING", defaultString(pushEvent.getRequestQueryString()));
this.variables.put("GITLAB_REQUEST_TOKEN", defaultString(pushEvent.getRequestSecretToken()));
Expand Down

0 comments on commit 04cac57

Please sign in to comment.