hudson.model.AbstractBuild.getExecutor()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(91)

本文整理了Java中hudson.model.AbstractBuild.getExecutor()方法的一些代码示例,展示了AbstractBuild.getExecutor()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AbstractBuild.getExecutor()方法的具体详情如下:
包路径:hudson.model.AbstractBuild
类名称:AbstractBuild
方法名:getExecutor

AbstractBuild.getExecutor介绍

暂无

代码示例

代码示例来源:origin: jenkinsci/jenkins

/**
 * Stops this build if it's still going.
 *
 * If we use this/executor/stop URL, it causes 404 if the build is already killed,
 * as {@link #getExecutor()} returns null.
 * 
 * @since 1.489
 */
@RequirePOST
public synchronized HttpResponse doStop() throws IOException, ServletException {
  Executor e = getExecutor();
  if (e==null)
    e = getOneOffExecutor();
  if (e!=null)
    return e.doStop();
  else
    // nothing is building
    return HttpResponses.forwardToPreviousPage();
}

代码示例来源:origin: jenkinsci/openstack-cloud-plugin

@Override
@SuppressWarnings("rawtypes")
public Environment setUp(AbstractBuild build, Launcher launcher, final BuildListener listener) {
  final Executor executor = build.getExecutor();
  if (executor != null) {
    final Computer c = executor.getOwner();
    if (c instanceof JCloudsComputer) {
      return new Environment() {
        @Override
        public boolean tearDown(AbstractBuild build, final BuildListener listener) throws IOException, InterruptedException {
          ((JCloudsComputer) c).setPendingDelete(true);
          return true;
        }
      };
    }
  }
  return new Environment() {};
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Stops this build if it's still going.
 *
 * If we use this/executor/stop URL, it causes 404 if the build is already killed,
 * as {@link #getExecutor()} returns null.
 */
public synchronized void doStop(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
  Executor e = getExecutor();
  if (e!=null)
    e.doStop(req,rsp);
  else
    // nothing is building
    rsp.forwardToPreviousPage(req);
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * Stops this build if it's still going.
 *
 * If we use this/executor/stop URL, it causes 404 if the build is already killed,
 * as {@link #getExecutor()} returns null.
 */
public synchronized void doStop(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
  Executor e = getExecutor();
  if (e!=null)
    e.doStop(req,rsp);
  else
    // nothing is building
    rsp.forwardToPreviousPage(req);
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * Stops this build if it's still going.
 *
 * If we use this/executor/stop URL, it causes 404 if the build is already killed,
 * as {@link #getExecutor()} returns null.
 */
public synchronized void doStop(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
  Executor e = getExecutor();
  if (e!=null)
    e.doStop(req,rsp);
  else
    // nothing is building
    rsp.forwardToPreviousPage(req);
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
 * Stops this build if it's still going.
 *
 * If we use this/executor/stop URL, it causes 404 if the build is already
 * killed, as {@link #getExecutor()} returns null.
 */
public synchronized void doStop(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
  Executor e = getExecutor();
  if (e != null) {
    e.doStop(req, rsp);
  } else  {
    // nothing is building
    rsp.forwardToPreviousPage(req);
  }
}
private static final Logger LOGGER = Logger.getLogger(AbstractBuild.class.getName());

代码示例来源:origin: jenkinsci/jclouds-plugin

@Override
@SuppressWarnings("rawtypes")
public Environment setUp(AbstractBuild build, Launcher launcher, final BuildListener listener) {
  final Executor x = build.getExecutor();
  if (null != x && JCloudsComputer.class.isInstance(x.getOwner())) {
    final JCloudsComputer c = (JCloudsComputer) x.getOwner();
    return new Environment() {
      @Override
      public boolean tearDown(AbstractBuild build, final BuildListener listener) throws IOException, InterruptedException {
        LOGGER.warning("Single-use slave " + c.getName() + " getting torn down.");
        c.setTemporarilyOffline(true, OfflineCause.create(Messages._OneOffCause()));
        // Fixes JENKINS-28403
        c.deleteSlave();
        return true;
      }
    };
  } else {
    return new Environment() {
    };
  }
}

代码示例来源:origin: org.hudsonci.plugins/run-condition

@Override
public boolean runPerform(final AbstractBuild<?, ?> build, final BuildListener listener) {
  String currentNode = build.getExecutor().getOwner().getName();
  currentNode = "".equals(currentNode) ? MASTER : currentNode;
  listener.getLogger().println(Messages.nodeCondition_check(currentNode, Arrays.toString(getAllowedNodes().toArray())));
  return getAllowedNodes().contains(currentNode);
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

@Override
  public String getShortDescription() {
    Executor e = build.getExecutor();
    String eta = "";
    if (e != null) {
      eta = Messages.AbstractProject_ETA(e.getEstimatedRemainingTime());
    }
    int lbn = build.getNumber();
    return Messages.AbstractProject_BuildInProgress(lbn, eta);
  }
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

@Override
  public String getShortDescription() {
    Executor e = build.getExecutor();
    String eta = "";
    if (e != null)
      eta = Messages.AbstractProject_ETA(e.getEstimatedRemainingTime());
    int lbn = build.getNumber();
    return Messages.AbstractProject_BuildInProgress(lbn, eta);
  }
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

@Override
  public String getShortDescription() {
    Executor e = build.getExecutor();
    String eta = "";
    if (e != null) {
      eta = Messages.AbstractProject_ETA(e.getEstimatedRemainingTime());
    }
    int lbn = build.getNumber();
    return Messages.AbstractProject_BuildInProgress(lbn, eta);
  }
}

代码示例来源:origin: hudson/hudson-2.x

@Override
  public String getShortDescription() {
    Executor e = build.getExecutor();
    String eta = "";
    if (e != null)
      eta = Messages.AbstractProject_ETA(e.getEstimatedRemainingTime());
    int lbn = build.getNumber();
    return Messages.AbstractProject_BuildInProgress(lbn, eta);
  }
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
 * Stops this build if it's still going.
 *
 * If we use this/executor/stop URL, it causes 404 if the build is already killed,
 * as {@link #getExecutor()} returns null.
 * 
 * @since 1.489
 */
@RequirePOST
public synchronized HttpResponse doStop() throws IOException, ServletException {
  Executor e = getExecutor();
  if (e==null)
    e = getOneOffExecutor();
  if (e!=null)
    return e.doStop();
  else
    // nothing is building
    return HttpResponses.forwardToPreviousPage();
}

代码示例来源:origin: jenkinsci/artifactory-plugin

if (isUseSpecs()) {
  String spec = SpecUtils.getSpecStringFromSpecConf(downloadSpec, build.getEnvironment(listener),
      build.getExecutor().getCurrentWorkspace(), listener.getLogger());
  FilePath workspace = build.getExecutor().getCurrentWorkspace();
  publishedDependencies = workspace.act(new FilesResolverCallable(
      new JenkinsBuildInfoLog(listener), username, password, resolverServer.getUrl(), spec, proxyConfiguration));

代码示例来源:origin: org.hudsonci.plugins/instant-messaging

Executor ex = build.getExecutor();
if (ex == null) {
  aborted = false; // how the hell does this happen o_O

代码示例来源:origin: jenkinsci/instant-messaging-plugin

Executor ex = build.getExecutor();
if (ex == null) {
  aborted = false; // how the hell does this happen o_O

相关文章

微信公众号

最新文章

更多

AbstractBuild类方法