• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java PullRequest类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.atlassian.stash.pull.PullRequest的典型用法代码示例。如果您正苦于以下问题:Java PullRequest类的具体用法?Java PullRequest怎么用?Java PullRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PullRequest类属于com.atlassian.stash.pull包,在下文中一共展示了PullRequest类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: pullRequestListener

import com.atlassian.stash.pull.PullRequest; //导入依赖的package包/类
@EventListener
public void pullRequestListener(PullRequestMergeActivityEvent pullRequestMergeActivityEvent) {
    Repository targetRepo = pullRequestMergeActivityEvent.getPullRequest().getToRef().getRepository();
    PullRequest pullRequest = pullRequestMergeActivityEvent.getPullRequest();

    RepositoryHook repositoryHook = repositoryHookService.getByKey(targetRepo, REPO_HOOK_KEY);
    if (repositoryHook.isEnabled() && pullRequestMergeActivityEvent.getActivity().getAction().equals(PullRequestAction.MERGED)) {
        Settings settings = repositoryHookService.getSettings(targetRepo, REPO_HOOK_KEY);
        String bypassKeyword = settings.getString(PullRequestMergeRulesCheck.SETTING_KEY_BYPASS_KEYWORD);
        String apiToken = settings.getString(PullRequestMergeRulesCheck.SETTING_KEY_HIPCHAT_API_TOKEN);
        String roomId = settings.getString(PullRequestMergeRulesCheck.SETTING_KEY_HIPCHAT_ROOM_ID);

        if (StringUtils.containsIgnoreCase(pullRequest.getTitle(), bypassKeyword)
                && isHipChatConfigured(settings)) {
            String message = String.format("<b>%s</b> bypassed merge checks for pull request <b>#%d</b> in <b>%s/%s</b> <br/>%s",
                    pullRequestMergeActivityEvent.getUser().getDisplayName(),
                    pullRequest.getId(),
                    targetRepo.getProject().getKey(),
                    targetRepo.getSlug(),
                    pullRequest.getTitle());

            HipChatClient client = new HipChatClient(apiToken);
            client.sendRoomNotification(new HipChatNotification(message, roomId, HipChatNotification.Color.RED));
        }
    }
}
 
开发者ID:scheerer,项目名称:stash-merge-rules-plugin,代码行数:27,代码来源:MergeCheckBypassListener.java


示例2: triggerBuild

import com.atlassian.stash.pull.PullRequest; //导入依赖的package包/类
@Override
public void triggerBuild(PullRequestEvent pullRequestEvent, BranchPredicate predicate) {
  final PullRequest pullRequest = pullRequestEvent.getPullRequest();
  final PullRequestTriggerSettings settings = getSettings(pullRequest);
  final Repository repository = getRepository(pullRequest);
  final String branchName = pullRequest.getToRef().getId();
  final List<BranchSettings> branchSettingsList = service.getBranchSettingsForBranch(repository, branchName);
  final Long prNumber = pullRequest.getId();

  if (prNumber != null) {
    if (settings.isEnabled()) {
      for (BranchSettings branchSettings : branchSettingsList) {
        if (predicate.matches(branchSettings)) {
          buildTriggerer.invoke(prNumber, settings, branchSettings);
        }
      }
    }
  } else {
    log.error("id of pull request is null: " + pullRequest);
  }
}
 
开发者ID:RichRelevance,项目名称:StashPRTriggerPlugin,代码行数:22,代码来源:TriggerImpl.java


示例3: automaticTriggerIsCalledOnRescopeChangingHashTest

import com.atlassian.stash.pull.PullRequest; //导入依赖的package包/类
@Test
public void automaticTriggerIsCalledOnRescopeChangingHashTest() {
  Trigger trigger = mock(Trigger.class);
  PullRequestRescopedEvent event = mock(PullRequestRescopedEvent.class);
  PullRequest pullRequest = mock(PullRequest.class);
  PullRequestRef fromRef = mock(PullRequestRef.class);

  when(event.getPreviousFromHash()).thenReturn("X");
  when(event.getPullRequest()).thenReturn(pullRequest);
  when(pullRequest.getFromRef()).thenReturn(fromRef);
  when(fromRef.getLatestChangeset()).thenReturn("Y");

  PullRequestHook pullRequestHook = new PullRequestHook(trigger);

  pullRequestHook.onPullRequestRescope(event);

  verify(trigger).automaticTrigger(event);
}
 
开发者ID:RichRelevance,项目名称:StashPRTriggerPlugin,代码行数:19,代码来源:PullRequestHookTest.java


示例4: triggerIsNotCalledOnRescopesWithSameHashTest

import com.atlassian.stash.pull.PullRequest; //导入依赖的package包/类
@Test
public void triggerIsNotCalledOnRescopesWithSameHashTest() {
  Trigger trigger = mock(Trigger.class);
  PullRequestRescopedEvent event = mock(PullRequestRescopedEvent.class);
  PullRequest pullRequest = mock(PullRequest.class);
  PullRequestRef fromRef = mock(PullRequestRef.class);

  when(event.getPreviousFromHash()).thenReturn("X");
  when(event.getPullRequest()).thenReturn(pullRequest);
  when(pullRequest.getFromRef()).thenReturn(fromRef);
  when(fromRef.getLatestChangeset()).thenReturn("X");

  PullRequestHook pullRequestHook = new PullRequestHook(trigger);

  pullRequestHook.onPullRequestRescope(event);

  verify(trigger, never()).automaticTrigger(event);
}
 
开发者ID:RichRelevance,项目名称:StashPRTriggerPlugin,代码行数:19,代码来源:PullRequestHookTest.java


示例5: automaticTriggerBuildIfBranchAutomaticBuildIsEnabledTest

import com.atlassian.stash.pull.PullRequest; //导入依赖的package包/类
@Test
public void automaticTriggerBuildIfBranchAutomaticBuildIsEnabledTest() {
  BuildTriggerer buildTriggerer = mock(BuildTriggerer.class);
  PullRequestEvent event = mock(PullRequestEvent.class);
  PullRequest pullRequest = mock(PullRequest.class);
  PullRequestRef ref = mock(PullRequestRef.class);
  Repository repository = mock(Repository.class);

  when(event.getPullRequest()).thenReturn(pullRequest);
  when(pullRequest.getToRef()).thenReturn(ref, ref);
  when(ref.getRepository()).thenReturn(repository);
  when(ref.getId()).thenReturn(branchName);
  when(pullRequest.getId()).thenReturn(1L);

  Trigger trigger = new TriggerImpl(settingsServiceEnabled, buildTriggerer);

  trigger.automaticTrigger(event);

  verify(buildTriggerer).invoke(1L, settingsEnabled, immutableBranchSettings);
}
 
开发者ID:RichRelevance,项目名称:StashPRTriggerPlugin,代码行数:21,代码来源:TriggerImplTest.java


示例6: automaticTriggerDoesNotBuildIfBranchAutomaticBuildIsDisabledTest

import com.atlassian.stash.pull.PullRequest; //导入依赖的package包/类
@Test
public void automaticTriggerDoesNotBuildIfBranchAutomaticBuildIsDisabledTest() {
  BuildTriggerer buildTriggerer = mock(BuildTriggerer.class);
  PullRequestEvent event = mock(PullRequestEvent.class);
  PullRequest pullRequest = mock(PullRequest.class);
  PullRequestRef ref = mock(PullRequestRef.class);
  Repository repository = mock(Repository.class);

  when(event.getPullRequest()).thenReturn(pullRequest);
  when(pullRequest.getToRef()).thenReturn(ref, ref);
  when(ref.getRepository()).thenReturn(repository);
  when(ref.getId()).thenReturn(branchName);
  when(pullRequest.getId()).thenReturn(1L);

  Trigger trigger = new TriggerImpl(settingsServiceOnDemand, buildTriggerer);

  trigger.automaticTrigger(event);

  verify(buildTriggerer, never()).invoke(anyLong(), any(PullRequestTriggerSettings.class), any(BranchSettings.class));
}
 
开发者ID:RichRelevance,项目名称:StashPRTriggerPlugin,代码行数:21,代码来源:TriggerImplTest.java


示例7: onDemandTriggerBuildsIfMessageMatchesSettingsTest

import com.atlassian.stash.pull.PullRequest; //导入依赖的package包/类
@Test
public void onDemandTriggerBuildsIfMessageMatchesSettingsTest() {
  PullRequestCommentAddedEvent event = mock(PullRequestCommentAddedEvent.class);
  Comment comment = mock(Comment.class);
  PullRequest pullRequest = mock(PullRequest.class);
  PullRequestRef ref = mock(PullRequestRef.class);
  Repository repository = mock(Repository.class);
  BuildTriggerer buildTriggerer = mock(BuildTriggerer.class);

  when(event.getComment()).thenReturn(comment);
  when(comment.getText()).thenReturn(retestMsg);
  when(event.getPullRequest()).thenReturn(pullRequest);
  when(pullRequest.getToRef()).thenReturn(ref);
  when(ref.getRepository()).thenReturn(repository);
  when(ref.getId()).thenReturn(branchName);
  when(pullRequest.getId()).thenReturn(1L);

  Trigger trigger = new TriggerImpl(settingsServiceEnabled, buildTriggerer);

  trigger.onDemandTrigger(event);

  verify(buildTriggerer).invoke(1L, settingsEnabled, immutableBranchSettings);
}
 
开发者ID:RichRelevance,项目名称:StashPRTriggerPlugin,代码行数:24,代码来源:TriggerImplTest.java


示例8: onDemandTriggerBuildsIfMessageMatchesRegexTest

import com.atlassian.stash.pull.PullRequest; //导入依赖的package包/类
@Test
public void onDemandTriggerBuildsIfMessageMatchesRegexTest() {
  PullRequestCommentAddedEvent event = mock(PullRequestCommentAddedEvent.class);
  Comment comment = mock(Comment.class);
  PullRequest pullRequest = mock(PullRequest.class);
  PullRequestRef ref = mock(PullRequestRef.class);
  Repository repository = mock(Repository.class);
  BuildTriggerer buildTriggerer = mock(BuildTriggerer.class);

  when(event.getComment()).thenReturn(comment);
  when(comment.getText()).thenReturn("KLAATU BARADA NIKTO");
  when(event.getPullRequest()).thenReturn(pullRequest);
  when(pullRequest.getToRef()).thenReturn(ref);
  when(ref.getRepository()).thenReturn(repository);
  when(ref.getId()).thenReturn(branchName);
  when(pullRequest.getId()).thenReturn(1L);

  Trigger trigger = new TriggerImpl(settingsServiceRegexEnabled, buildTriggerer);

  trigger.onDemandTrigger(event);

  verify(buildTriggerer).invoke(1L, settingsRegexEnabled, immutableBranchSettings);
}
 
开发者ID:RichRelevance,项目名称:StashPRTriggerPlugin,代码行数:24,代码来源:TriggerImplTest.java


示例9: onDemandTriggersOnlyMatchingBranchesWithMatchingMessagesTest

import com.atlassian.stash.pull.PullRequest; //导入依赖的package包/类
@Test
public void onDemandTriggersOnlyMatchingBranchesWithMatchingMessagesTest() {
  PullRequestCommentAddedEvent event = mock(PullRequestCommentAddedEvent.class);
  Comment comment = mock(Comment.class);
  PullRequest pullRequest = mock(PullRequest.class);
  PullRequestRef ref = mock(PullRequestRef.class);
  Repository repository = mock(Repository.class);
  BuildTriggerer buildTriggerer = mock(BuildTriggerer.class);

  when(event.getComment()).thenReturn(comment);
  when(comment.getText()).thenReturn(alternateMsg);

  when(event.getPullRequest()).thenReturn(pullRequest);
  when(pullRequest.getToRef()).thenReturn(ref);
  when(ref.getRepository()).thenReturn(repository);
  when(ref.getId()).thenReturn(branchName);
  when(pullRequest.getId()).thenReturn(1L);

  Trigger trigger = new TriggerImpl(settingsServiceEnabledMultiBranch, buildTriggerer);

  trigger.onDemandTrigger(event);

  InOrder inOrder = inOrder(buildTriggerer);
  inOrder.verify(buildTriggerer).invoke(1L, settingsEnabled, alternateBranchSettings);
  inOrder.verifyNoMoreInteractions();
}
 
开发者ID:RichRelevance,项目名称:StashPRTriggerPlugin,代码行数:27,代码来源:TriggerImplTest.java


示例10: onDemandDoesNotTriggerBuildsIfMessageDoesNotMatchSettingsTest

import com.atlassian.stash.pull.PullRequest; //导入依赖的package包/类
@Test
public void onDemandDoesNotTriggerBuildsIfMessageDoesNotMatchSettingsTest() {
  PullRequestCommentAddedEvent event = mock(PullRequestCommentAddedEvent.class);
  Comment comment = mock(Comment.class);
  PullRequest pullRequest = mock(PullRequest.class);
  PullRequestRef ref = mock(PullRequestRef.class);
  Repository repository = mock(Repository.class);
  BuildTriggerer buildTriggerer = mock(BuildTriggerer.class);

  when(event.getComment()).thenReturn(comment);
  when(comment.getText()).thenReturn("Do Not Retest");
  when(event.getPullRequest()).thenReturn(pullRequest);
  when(pullRequest.getToRef()).thenReturn(ref);
  when(ref.getRepository()).thenReturn(repository);
  when(ref.getId()).thenReturn(branchName);
  when(pullRequest.getId()).thenReturn(1L);

  Trigger trigger = new TriggerImpl(settingsServiceEnabled, buildTriggerer);

  trigger.onDemandTrigger(event);

  verify(buildTriggerer, never()).invoke(anyLong(), any(PullRequestTriggerSettings.class), any(BranchSettings.class));
}
 
开发者ID:RichRelevance,项目名称:StashPRTriggerPlugin,代码行数:24,代码来源:TriggerImplTest.java


示例11: onDemandDoesNotTriggerBuildsIfMessageIsEmptyTest

import com.atlassian.stash.pull.PullRequest; //导入依赖的package包/类
@Test
public void onDemandDoesNotTriggerBuildsIfMessageIsEmptyTest() {
  PullRequestCommentAddedEvent event = mock(PullRequestCommentAddedEvent.class);
  Comment comment = mock(Comment.class);
  PullRequest pullRequest = mock(PullRequest.class);
  PullRequestRef ref = mock(PullRequestRef.class);
  Repository repository = mock(Repository.class);
  BuildTriggerer buildTriggerer = mock(BuildTriggerer.class);

  when(event.getComment()).thenReturn(comment);
  when(comment.getText()).thenReturn(retestMsg);
  when(event.getPullRequest()).thenReturn(pullRequest);
  when(pullRequest.getToRef()).thenReturn(ref);
  when(ref.getRepository()).thenReturn(repository);
  when(ref.getId()).thenReturn(branchName);
  when(pullRequest.getId()).thenReturn(1L);

  Trigger trigger = new TriggerImpl(settingsServiceEmptyMsg, buildTriggerer);

  trigger.onDemandTrigger(event);

  verify(buildTriggerer, never()).invoke(anyLong(), any(PullRequestTriggerSettings.class), any(BranchSettings.class));
}
 
开发者ID:RichRelevance,项目名称:StashPRTriggerPlugin,代码行数:24,代码来源:TriggerImplTest.java


示例12: triggerBuildDoesNotTriggerBuildsIfRepositoryDisabledTest

import com.atlassian.stash.pull.PullRequest; //导入依赖的package包/类
@Test
public void triggerBuildDoesNotTriggerBuildsIfRepositoryDisabledTest() {
  BuildTriggerer buildTriggerer = mock(BuildTriggerer.class);
  PullRequestEvent event = mock(PullRequestEvent.class);
  PullRequest pullRequest = mock(PullRequest.class);
  PullRequestRef ref = mock(PullRequestRef.class);
  Repository repository = mock(Repository.class);

  when(event.getPullRequest()).thenReturn(pullRequest);
  when(pullRequest.getToRef()).thenReturn(ref, ref);
  when(ref.getRepository()).thenReturn(repository);
  when(ref.getId()).thenReturn(branchName);

  Trigger trigger = new TriggerImpl(settingsServiceDisabled, buildTriggerer);

  trigger.triggerBuild(event, AlwaysTruePredicate.instance);

  verify(buildTriggerer, never()).invoke(anyLong(), any(PullRequestTriggerSettings.class), any(BranchSettings.class));
}
 
开发者ID:RichRelevance,项目名称:StashPRTriggerPlugin,代码行数:20,代码来源:TriggerImplTest.java


示例13: triggerBuildDoesNotTriggerBuildsIfBranchSettingsIsNullTest

import com.atlassian.stash.pull.PullRequest; //导入依赖的package包/类
@Test
public void triggerBuildDoesNotTriggerBuildsIfBranchSettingsIsNullTest() {
  BuildTriggerer buildTriggerer = mock(BuildTriggerer.class);
  PullRequestEvent event = mock(PullRequestEvent.class);
  PullRequest pullRequest = mock(PullRequest.class);
  PullRequestRef ref = mock(PullRequestRef.class);
  Repository repository = mock(Repository.class);

  when(event.getPullRequest()).thenReturn(pullRequest);
  when(pullRequest.getToRef()).thenReturn(ref, ref);
  when(ref.getRepository()).thenReturn(repository);
  when(ref.getId()).thenReturn("another branch");

  Trigger trigger = new TriggerImpl(settingsServiceEnabled, buildTriggerer);

  trigger.triggerBuild(event, AlwaysTruePredicate.instance);

  verify(buildTriggerer, never()).invoke(anyLong(), any(PullRequestTriggerSettings.class), any(BranchSettings.class));
}
 
开发者ID:RichRelevance,项目名称:StashPRTriggerPlugin,代码行数:20,代码来源:TriggerImplTest.java


示例14: triggerBuildBuildsIfEnabledAndBranchSettingsExistAndAutomaticBuildIsEnabledTest

import com.atlassian.stash.pull.PullRequest; //导入依赖的package包/类
@Test
public void triggerBuildBuildsIfEnabledAndBranchSettingsExistAndAutomaticBuildIsEnabledTest() {
  BuildTriggerer buildTriggerer = mock(BuildTriggerer.class);
  PullRequestEvent event = mock(PullRequestEvent.class);
  PullRequest pullRequest = mock(PullRequest.class);
  PullRequestRef ref = mock(PullRequestRef.class);
  Repository repository = mock(Repository.class);

  when(event.getPullRequest()).thenReturn(pullRequest);
  when(pullRequest.getToRef()).thenReturn(ref, ref);
  when(ref.getRepository()).thenReturn(repository);
  when(ref.getId()).thenReturn(branchName);
  when(pullRequest.getId()).thenReturn(1L);

  Trigger trigger = new TriggerImpl(settingsServiceEnabled, buildTriggerer);

  trigger.triggerBuild(event, AlwaysTruePredicate.instance);

  verify(buildTriggerer).invoke(1L, settingsEnabled, immutableBranchSettings);
}
 
开发者ID:RichRelevance,项目名称:StashPRTriggerPlugin,代码行数:21,代码来源:TriggerImplTest.java


示例15: triggerBuildTriggersMultipleBuildsIfMoreThanOneBranchMatchesNameTest

import com.atlassian.stash.pull.PullRequest; //导入依赖的package包/类
@Test
public void triggerBuildTriggersMultipleBuildsIfMoreThanOneBranchMatchesNameTest() {
  BuildTriggerer buildTriggerer = mock(BuildTriggerer.class);
  PullRequestEvent event = mock(PullRequestEvent.class);
  PullRequest pullRequest = mock(PullRequest.class);
  PullRequestRef ref = mock(PullRequestRef.class);
  Repository repository = mock(Repository.class);

  when(event.getPullRequest()).thenReturn(pullRequest);
  when(pullRequest.getToRef()).thenReturn(ref, ref);
  when(ref.getRepository()).thenReturn(repository);
  when(ref.getId()).thenReturn(branchName);
  when(pullRequest.getId()).thenReturn(1L);

  Trigger trigger = new TriggerImpl(settingsServiceEnabledMultiBranch, buildTriggerer);

  trigger.triggerBuild(event, AlwaysTruePredicate.instance);

  verify(buildTriggerer).invoke(1L, settingsEnabled, immutableBranchSettings);
  verify(buildTriggerer).invoke(1L, settingsEnabled, wildcardBranchSettings);
}
 
开发者ID:RichRelevance,项目名称:StashPRTriggerPlugin,代码行数:22,代码来源:TriggerImplTest.java


示例16: listenToPullRequestEvents

import com.atlassian.stash.pull.PullRequest; //导入依赖的package包/类
/**
 * Ensures all repositories with pull requests have a configuration, and all pull requests have a configuration.
 * 
 * @param pre
 */
@EventListener
public void listenToPullRequestEvents(PullRequestEvent pre) {
    PullRequest pr = pre.getPullRequest();
    Repository repo = pr.getToRef().getRepository();
    if (pr.getId() == null) {
        log.debug("Got NULL PR_ID, ignoring until PR is fully materialized");
        return;
    }
    try {
        log.trace("Ensuring DisapprovalConfiguration exists for REPO " + repo.getId());
        cpm.getDisapprovalConfiguration(repo);
        log.trace("Ensuring PullRequestDisapproval exists for PR " + pr.getId());
        cpm.getPullRequestDisapproval(pr);
    } catch (Exception e) {
        log.error("Undeclared exception: ", e);
        return;
    }
}
 
开发者ID:palantir,项目名称:stash-disapproval-plugin,代码行数:24,代码来源:PullRequestMetadataDeRuiner.java


示例17: writeHtml

import com.atlassian.stash.pull.PullRequest; //导入依赖的package包/类
@Override
public void writeHtml(Writer writer, Map<String, Object> context) throws IOException {
    final String DISAPPROVED_HTML = "<font color=\"#AA0000\">ಠ_ಠ</font> by __USER__";
    final String UNDISAPPROVED_HTML = "<font color=\"#00AA00\">( ͡° ͜ʖ ͡°)</font> by __USER__";
    try {
        // TODO: need this?  Repository repo = (Repository) context.get("repository");
        PullRequest pr = (PullRequest) context.get("pullRequest");
        PullRequestDisapproval prd = pm.getPullRequestDisapproval(pr);

        log.error("TRACE TRACE:");
        if (prd.isDisapproved()) {
            writer.append(DISAPPROVED_HTML.replace("__USER__", prd.getDisapprovedBy()));
        } else {
            writer.append(UNDISAPPROVED_HTML.replace("__USER__", prd.getDisapprovedBy()));
        }
    } catch (SQLException e) {
        throw new IOException(e);
    }
}
 
开发者ID:palantir,项目名称:stash-disapproval-plugin,代码行数:20,代码来源:DisapprovalStatusWebPanel.java


示例18: setPullRequestDisapproval

import com.atlassian.stash.pull.PullRequest; //导入依赖的package包/类
public static void setPullRequestDisapproval(ActiveObjects ao, PullRequest pr, String username,
    boolean isDisapproved) throws SQLException {
    Repository repo = pr.getToRef().getRepository();
    PullRequestDisapproval[] disapprovals =
        ao.find(PullRequestDisapproval.class,
            Query.select().where("REPO_ID = ? and PR_ID = ?", repo.getId(), pr.getId()));
    if (disapprovals.length == 0) {
        PullRequestDisapproval prd =
            ao.create(PullRequestDisapproval.class, new DBParam("REPO_ID", repo.getId()),
                new DBParam("PR_ID", pr.getId()), new DBParam("USERNAME", username));
        prd.setDisapproved(isDisapproved);
        prd.save();
        return;
    }
    disapprovals[0].setDisapprovedBy(username);
    disapprovals[0].setDisapproved(isDisapproved);
    disapprovals[0].save();
}
 
开发者ID:palantir,项目名称:stash-disapproval-plugin,代码行数:19,代码来源:PullRequestDisapprovalImpl.java


示例19: perform

import com.atlassian.stash.pull.PullRequest; //导入依赖的package包/类
@Override
public Object perform() throws Throwable {
    PullRequest pr = pullrequestService.getById(repositoryId, pullRequestId); //this make sure we always working on the latest change set
    if (pr != null) {
        PullRequestData prd = new PullRequestData(pr);
        String jenkinsBaseUrl = jenkinsCI.nextCIServer(prd.slug);
        if (jenkinsCI.validateSettings(jenkinsBaseUrl,prd.slug)) {
            log.debug(String.format("trigger build with parameter (%s, %s, %s, %s, %s, %s,%s",prd.repositoryId, prd.latestChanges, prd.pullRequestId,prd.title,prd.slug,eventType,jenkinsBaseUrl));
            jenkinsCI.triggerBuild(prd.repositoryId, prd.latestChanges, prd.pullRequestId,prd.title,prd.slug,eventType, 0,jenkinsBaseUrl, prd.projectKey, prd.fromBranchId, prd.toBranchId);
        } else {
            log.warn("Jenkins base URL & Build reference field is missing, please add the information in the pull-in settings");
        }
    } else {
        log.warn(String.format("No able to retrieve the pull-request with the key repository id (%s) and pull-request id (%s)", repositoryId,pullRequestId));
    }
    return null;
}
 
开发者ID:umbrew,项目名称:stash-pullrequest-jenkins,代码行数:18,代码来源:JenkinsJobScheduler.java


示例20: triggerBuild

import com.atlassian.stash.pull.PullRequest; //导入依赖的package包/类
public void triggerBuild(final Repository repo, final JobType jobType,
    final PullRequest pr) {

    final String username = um.getRemoteUser().getUsername();
    final StashUser su = us.findUserByNameOrEmail(username);

    es.submit(new Callable<Void>() {

        @Override
        public Void call() throws Exception {
            // TODO: See if we can do something like StateTransferringExecutorService here instead
            ss.impersonating(su, "Running as user '" + username + "' in alternate thread asynchronously")
                .call(new Operation<Void, Exception>() {

                    @Override
                    public Void perform() throws Exception {
                        synchronousTriggerBuild(repo, jobType, pr);
                        return null;
                    }
                });
            return null;
        };
    });
}
 
开发者ID:palantir,项目名称:stashbot,代码行数:25,代码来源:JenkinsManager.java



注:本文中的com.atlassian.stash.pull.PullRequest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java NaccacheSternKeyParameters类代码示例发布时间:2022-05-22
下一篇:
Java MorphShape类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap