本文整理了Java中hudson.model.Run.replaceAction
方法的一些代码示例,展示了Run.replaceAction
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Run.replaceAction
方法的具体详情如下:
包路径:hudson.model.Run
类名称:Run
方法名:replaceAction
暂无
代码示例来源:origin: jenkinsci/jenkins
@Override
public void onAddedTo(Run build) {
this.run = build;
try {
BuildAction a = new BuildAction(build);
FileUtils.writeStringToFile(a.getPollingLogFile(),pollingLog);
build.replaceAction(a);
} catch (IOException e) {
LOGGER.log(WARNING,"Failed to persist the polling log",e);
}
pollingLog = null;
}
代码示例来源:origin: jenkinsci/jenkins
@Override
protected int run() throws Exception {
Run r = getCurrentlyBuilding();
r.checkPermission(Run.UPDATE);
StringParameterValue p = new StringParameterValue(name, value);
ParametersAction a = r.getAction(ParametersAction.class);
if (a!=null) {
r.replaceAction(a.createUpdated(Collections.singleton(p)));
} else {
r.addAction(new ParametersAction(p));
}
return 0;
}
}
代码示例来源:origin: org.jenkins-ci.plugins.workflow/workflow-api
@Override public void copy(Run<?, ?> original, Run<?, ?> copy, TaskListener listener) throws IOException, InterruptedException {
for (Class<? extends Action> type : COPIED_ACTIONS) {
Action a = original.getAction(type);
if (a != null) {
// Especially for ParametersAction we must replace any existing action.
// For example, scheduleBuild2 will typically create an instance from default parameter values.
copy.replaceAction(a);
}
}
}
代码示例来源:origin: jenkinsci/ansicolor-plugin
@Override
public void setUp(Context context, Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener,
EnvVars initialEnvironment) throws IOException, InterruptedException {
build.replaceAction(new ColorizedAction(colorMapName));
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
@Override
public void onAddedTo(Run build) {
this.run = build;
try {
BuildAction a = new BuildAction(build);
FileUtils.writeStringToFile(a.getPollingLogFile(),pollingLog);
build.replaceAction(a);
} catch (IOException e) {
LOGGER.log(WARNING,"Failed to persist the polling log",e);
}
pollingLog = null;
}
代码示例来源:origin: jenkinsci/cucumber-reports-plugin
@Override
public void perform(@Nonnull Run<?, ?> run, @Nonnull FilePath workspace, @Nonnull Launcher launcher, @Nonnull TaskListener listener)
throws InterruptedException, IOException {
keepBackwardCompatibility();
generateReport(run, workspace, listener);
SafeArchiveServingRunAction caa = new SafeArchiveServingRunAction(run, new File(run.getRootDir(), ReportBuilder.BASE_DIRECTORY),
ReportBuilder.BASE_DIRECTORY, ReportBuilder.HOME_PAGE, CucumberReportBaseAction.ICON_NAME, Messages.SidePanel_DisplayName());
run.replaceAction(caa);
}
代码示例来源:origin: KostyaSha/github-integration-plugin
@Override
public void onAddedTo(@Nonnull Run run) {
if (run.getParent().getParent() instanceof SCMSourceOwner) {
// skip multibranch
return;
}
// move polling log from cause to action
try {
GitHubPRPollingLogAction action = new GitHubPRPollingLogAction(run);
FileUtils.writeStringToFile(action.getPollingLogFile(), getPollingLog());
run.replaceAction(action);
} catch (IOException e) {
LOGGER.warn("Failed to persist the polling log", e);
}
setPollingLog(null);
}
代码示例来源:origin: KostyaSha/github-integration-plugin
@Override
public void onAddedTo(@Nonnull Run run) {
if (run.getParent().getParent() instanceof SCMSourceOwner) {
// skip multibranch
return;
}
// move polling log from cause to action
try {
GitHubBranchPollingLogAction action = new GitHubBranchPollingLogAction(run);
writeStringToFile(action.getPollingLogFile(), getPollingLog());
run.replaceAction(action);
} catch (IOException ex) {
LOG.warn("Failed to persist the polling log", ex);
}
setPollingLog(null);
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
@Override
protected int run() throws Exception {
Run r = getCurrentlyBuilding();
r.checkPermission(Run.UPDATE);
StringParameterValue p = new StringParameterValue(name, value);
ParametersAction a = r.getAction(ParametersAction.class);
if (a!=null) {
r.replaceAction(a.createUpdated(Collections.singleton(p)));
} else {
r.addAction(new ParametersAction(p));
}
return 0;
}
}
代码示例来源:origin: jenkinsci/ansicolor-plugin
/**
* {@inheritDoc}
*/
@Override
public boolean start() throws Exception {
StepContext context = getContext();
context.get(Run.class).replaceAction(new ColorizedAction(colorMapName));
EnvironmentExpander currentEnvironment = context.get(EnvironmentExpander.class);
EnvironmentExpander terminalEnvironment = EnvironmentExpander.constant(Collections.singletonMap("TERM", colorMapName));
context.newBodyInvoker()
.withContext(EnvironmentExpander.merge(currentEnvironment, terminalEnvironment))
.withCallback(BodyExecutionCallback.wrap(context)).start();
return false;
}
内容来源于网络,如有侵权,请联系作者删除!