Search in sources :

Example 1 with GitLabSCMHeadMetadataAction

use of argelbargel.jenkins.plugins.gitlab_branch_source.actions.GitLabSCMHeadMetadataAction in project gitlab-branch-source-plugin by Argelbargel.

the class GitLabSCMRunListener method onCompleted.

@Override
public void onCompleted(Run<?, ?> build, @Nonnull TaskListener listener) {
    GitLabSCMHeadMetadataAction metadata = getMetadataAction(build);
    GitLabSCMPublishAction publishAction = build.getParent().getAction(GitLabSCMPublishAction.class);
    if (metadata != null && publishAction != null) {
        publishAction.publishResult(build, metadata);
    }
    if (build.getResult() == SUCCESS) {
        GitLabSCMAcceptMergeRequestAction acceptAction = build.getParent().getAction(GitLabSCMAcceptMergeRequestAction.class);
        if (acceptAction != null) {
            acceptAction.acceptMergeRequest(build, listener);
        }
    }
}
Also used : GitLabSCMHeadMetadataAction(argelbargel.jenkins.plugins.gitlab_branch_source.actions.GitLabSCMHeadMetadataAction) GitLabSCMAcceptMergeRequestAction(argelbargel.jenkins.plugins.gitlab_branch_source.actions.GitLabSCMAcceptMergeRequestAction) GitLabSCMPublishAction(argelbargel.jenkins.plugins.gitlab_branch_source.actions.GitLabSCMPublishAction)

Example 2 with GitLabSCMHeadMetadataAction

use of argelbargel.jenkins.plugins.gitlab_branch_source.actions.GitLabSCMHeadMetadataAction in project gitlab-branch-source-plugin by Argelbargel.

the class GitLabSCMRunListener method onStarted.

@Override
public void onStarted(Run<?, ?> build, TaskListener listener) {
    GitLabSCMHeadMetadataAction metadata = getMetadataAction(build);
    GitLabSCMPublishAction publishAction = build.getParent().getAction(GitLabSCMPublishAction.class);
    if (metadata != null && publishAction != null) {
        GitLabSCMCauseAction cause = build.getAction(GitLabSCMCauseAction.class);
        String description = (cause != null) ? cause.getDescription() : "";
        publishAction.updateBuildDescription(build, description, listener);
        publishAction.publishStarted(build, metadata, description);
    }
}
Also used : GitLabSCMHeadMetadataAction(argelbargel.jenkins.plugins.gitlab_branch_source.actions.GitLabSCMHeadMetadataAction) GitLabSCMCauseAction(argelbargel.jenkins.plugins.gitlab_branch_source.actions.GitLabSCMCauseAction) GitLabSCMPublishAction(argelbargel.jenkins.plugins.gitlab_branch_source.actions.GitLabSCMPublishAction)

Aggregations

GitLabSCMHeadMetadataAction (argelbargel.jenkins.plugins.gitlab_branch_source.actions.GitLabSCMHeadMetadataAction)2 GitLabSCMPublishAction (argelbargel.jenkins.plugins.gitlab_branch_source.actions.GitLabSCMPublishAction)2 GitLabSCMAcceptMergeRequestAction (argelbargel.jenkins.plugins.gitlab_branch_source.actions.GitLabSCMAcceptMergeRequestAction)1 GitLabSCMCauseAction (argelbargel.jenkins.plugins.gitlab_branch_source.actions.GitLabSCMCauseAction)1