public Environment superSetUpEnvironment(AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException, RunnerAbortedException { return super.setUpEnvironment(build, launcher, listener); }
@Override public Environment setUpEnvironment(AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException, RunnerAbortedException { initPython(); if (pexec.isImplemented(3)) { return (Environment) pexec.execPython("set_up_environment", build, launcher, listener); } else { return super.setUpEnvironment(build, launcher, listener); } }
@Override public Environment setUpEnvironment(AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException { //doing this in the method onStarted would make more sense but you are not allowed to fail a build //at that point. This method is the first one called that we can fail the build. ReplicationFailedAction replicationFailedAction = build.getAction(ReplicationFailedAction.class); if (replicationFailedAction != null) { throw new AbortException(replicationFailedAction.getReason()); } return super.setUpEnvironment(build, launcher, listener); } }
@Override public Environment setUpEnvironment(AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException, Run.RunnerAbortedException { AbstractProject project = build.getProject(); //only watch coverity builds that are enabled CoverityPublisher publisher = (CoverityPublisher) project.getPublishersList().get(CoverityPublisher.class); if(publisher == null || publisher.getInvocationAssistance() == null) { return super.setUpEnvironment(build, launcher, listener); } //TODO: use ConsoleNote and ConsoleAnnotator to improve output appearance listener.getLogger().println("\nChecking Coverity configuration..."); CheckConfig cc = new CheckConfig(publisher, build, launcher, listener); cc.check(); for(CheckConfig.Status s : cc.getStatus()) { listener.getLogger().println(s.getStatus()); } if(cc.isValid()) { listener.getLogger().println("Configuration is valid.\n"); return super.setUpEnvironment(build, launcher, listener); } else { listener.getLogger().println("Configuration is invalid. Aborting build.\n"); throw new Run.RunnerAbortedException(); } }