本文整理了Java中hudson.model.Run.getAbsoluteUrl
方法的一些代码示例,展示了Run.getAbsoluteUrl
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Run.getAbsoluteUrl
方法的具体详情如下:
包路径:hudson.model.Run
类名称:Run
方法名:getAbsoluteUrl
[英]Obtains the absolute URL to this build.
[中]获取此生成的绝对URL。
代码示例来源:origin: jenkinsci/tfs-plugin
@Override
public void perform(
@Nonnull final Run<?, ?> run,
@Nonnull final FilePath workspace,
@Nonnull final Launcher launcher,
@Nonnull final TaskListener listener
) throws InterruptedException, IOException {
try {
final String absoluteUrl = run.getAbsoluteUrl();
final ArrayList<ResourceRef> workItems = new ArrayList<ResourceRef>();
final URI collectionUri = TeamPullRequestMergedDetailsAction.addWorkItemsForRun(run, workItems);
if (collectionUri != null) {
final TeamRestClient client = new TeamRestClient(collectionUri);
for (final ResourceRef workItem : workItems) {
final String workItemIdString = workItem.getId();
final Integer workItemId = Integer.valueOf(workItemIdString, 10);
client.addHyperlinkToWorkItem(workItemId, absoluteUrl);
}
// Send telemetry
TelemetryHelper.sendEvent("team-workitem-update", new TelemetryHelper.PropertyMapBuilder()
.serverContext(collectionUri.toString(), collectionUri.toString())
.build());
}
} catch (final IllegalArgumentException e) {
listener.error(e.getMessage());
} catch (final Exception e) {
e.printStackTrace(listener.error("Error while trying to update associated work items in TFS/Team Services"));
}
}
代码示例来源:origin: com.ibm.devops/ibm-cloud-devops
/**
* Get the current Jenkins job url
* @param build
* @param printStream
* @return
*/
public static String getJobUrl(Run build, PrintStream printStream) {
String jobUrl;
if (checkRootUrl(printStream)) {
jobUrl = Jenkins.getInstance().getRootUrl() + build.getUrl();
} else {
jobUrl = build.getAbsoluteUrl();
}
return jobUrl;
}
代码示例来源:origin: jenkinsci/tfs-plugin
public static TeamGitStatus fromRun(@Nonnull final Run<?, ?> run) {
final TeamGitStatus status = new TeamGitStatus();
final Result result = run.getResult();
if (result == null) {
status.state = GitStatusState.Pending;
status.description = status.state.toString();
} else {
status.state = RESULT_TO_STATE.get(result);
status.description = result.toString();
}
final Job<?, ?> job = run.getParent();
status.description = job.getDisplayName() + run.getDisplayName() + ": " + status.description;
status.targetUrl = run.getAbsoluteUrl();
status.context = getStatusContext(job);
return status;
}
代码示例来源:origin: com.ibm.devops/ibm-cloud-devops
jobUrl = Jenkins.getInstance().getRootUrl() + build.getUrl();
} else {
jobUrl = build.getAbsoluteUrl();
代码示例来源:origin: jenkinsci/warnings-ng-plugin
@SuppressWarnings("deprecation") // this is the only way for remote API calls to obtain the absolute path
private ToolApi createToolApi(final ResultAction result) {
return new ToolApi(result.getId(), result.getDisplayName(),
result.getOwner().getAbsoluteUrl() + result.getUrlName(), result.getResult().getTotalSize());
}
内容来源于网络,如有侵权,请联系作者删除!