本文整理汇总了Java中jenkins.scm.api.SCMSourceEvent类的典型用法代码示例。如果您正苦于以下问题:Java SCMSourceEvent类的具体用法?Java SCMSourceEvent怎么用?Java SCMSourceEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SCMSourceEvent类属于jenkins.scm.api包,在下文中一共展示了SCMSourceEvent类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: retrieveActions
import jenkins.scm.api.SCMSourceEvent; //导入依赖的package包/类
@NonNull
@Override
protected List<Action> retrieveActions(SCMSourceEvent event, @NonNull TaskListener listener)
throws IOException, InterruptedException {
if (giteaRepository == null) {
try (GiteaConnection c = gitea().open()) {
listener.getLogger().format("Looking up repository %s/%s%n", repoOwner, repository);
giteaRepository = c.fetchRepository(repoOwner, repository);
}
}
List<Action> result = new ArrayList<>();
result.add(new ObjectMetadataAction(null, giteaRepository.getDescription(), giteaRepository.getWebsite()));
result.add(new GiteaLink("icon-gitea-repo", UriTemplate.buildFromTemplate(serverUrl)
.path(UriTemplateBuilder.var("owner"))
.path(UriTemplateBuilder.var("repository"))
.build()
.set("owner", repoOwner)
.set("repository", repository)
.expand()
));
return result;
}
示例2: handleSystemHook
import jenkins.scm.api.SCMSourceEvent; //导入依赖的package包/类
private void handleSystemHook(String id, HttpServletRequest request) throws IOException {
try {
LOGGER.fine("handling system-hook for " + id);
SystemHook hook = readHook(SystemHook.class, request);
SCMSourceEvent.fireNow(GitLabSCMSourceEvent.create(id, hook, originOf(request)));
} catch (IllegalArgumentException e) {
LOGGER.warning("ignoring system hook: " + e.getMessage());
}
}
示例3: retrieve
import jenkins.scm.api.SCMSourceEvent; //导入依赖的package包/类
@Nonnull
List<Action> retrieve(@CheckForNull SCMSourceEvent event, @Nonnull TaskListener listener) throws IOException {
GitLabProject project = source.getProject();
return asList(
new ObjectMetadataAction(project.getNameWithNamespace(), project.getDescription(), project.getWebUrl()),
new GitLabProjectAvatarMetadataAction(project.getId(), source.getSourceSettings().getConnectionName()),
GitLabLinkAction.toProject(project));
}
示例4: process
import jenkins.scm.api.SCMSourceEvent; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void process(GiteaRepositorySCMEvent event) {
SCMSourceEvent.fireNow(event);
}
示例5: visitSources
import jenkins.scm.api.SCMSourceEvent; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void visitSources(@NonNull SCMSourceObserver observer, @NonNull SCMSourceEvent<?> event)
throws IOException, InterruptedException {
visitSource(event.getSourceName(), observer);
}
示例6: retrieveActions
import jenkins.scm.api.SCMSourceEvent; //导入依赖的package包/类
@Nonnull
@Override
protected List<Action> retrieveActions(@CheckForNull SCMSourceEvent event, @Nonnull TaskListener listener) throws IOException {
return actions.retrieve(event, listener);
}