hudson.model.AbstractProject.getBuildCause()方法的使用及代码示例

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

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

AbstractProject.getBuildCause介绍

[英]Computes the build cause, using RemoteCause or UserCause as appropriate.
[中]根据需要使用RemoteCause或UserCause计算生成原因。

代码示例

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

public void buildWithParameters(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
  List<ParameterValue> values = new ArrayList<ParameterValue>();
  for (ParameterDefinition d: parameterDefinitions) {
    ParameterValue value = d.createValue(req);
    if (value != null) {
      values.add(value);
    } else {
      throw new IllegalArgumentException("Parameter " + d.getName() + " was missing.");
    }
  }
  Hudson.getInstance().getQueue().schedule(
      owner, owner.getDelay(req), new ParametersAction(values), owner.getBuildCause(req));
  // send the user back to the job top page.
  rsp.sendRedirect(".");
}

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

public void buildWithParameters(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
  List<ParameterValue> values = new ArrayList<ParameterValue>();
  for (ParameterDefinition d : parameterDefinitions) {
    ParameterValue value = d.createValue(req);
    if (value != null) {
      values.add(value);
    } else {
      throw new IllegalArgumentException("Parameter " + d.getName() + " was missing.");
    }
  }
  Hudson.getInstance().getQueue().schedule(
      owner, owner.getDelay(req), new ParametersAction(values), owner.getBuildCause(req));
  // send the user back to the job top page.
  rsp.sendRedirect(".");
}

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

public void buildWithParameters(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
  List<ParameterValue> values = new ArrayList<ParameterValue>();
  for (ParameterDefinition d: parameterDefinitions) {
    ParameterValue value = d.createValue(req);
    if (value != null) {
      values.add(value);
    } else {
      throw new IllegalArgumentException("Parameter " + d.getName() + " was missing.");
    }
  }
  Hudson.getInstance().getQueue().schedule(
      owner, owner.getDelay(req), new ParametersAction(values), owner.getBuildCause(req));
  // send the user back to the job top page.
  rsp.sendRedirect(".");
}

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

public void buildWithParameters(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
  List<ParameterValue> values = new ArrayList<ParameterValue>();
  for (ParameterDefinition d: parameterDefinitions) {
    ParameterValue value = d.createValue(req);
    if (value != null) {
      values.add(value);
    } else {
      throw new IllegalArgumentException("Parameter " + d.getName() + " was missing.");
    }
  }
  Hudson.getInstance().getQueue().schedule(
      owner, owner.getDelay(req), new ParametersAction(values), owner.getBuildCause(req));
  // send the user back to the job top page.
  rsp.sendRedirect(".");
}

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

/**
 * Schedules a new build command.
 */
public void doBuild(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
  BuildAuthorizationToken.checkPermission(this, authToken, req, rsp);
  // if a build is parameterized, let that take over
  ParametersDefinitionProperty pp = getProperty(ParametersDefinitionProperty.class);
  if (pp != null) {
    pp._doBuild(req, rsp);
    return;
  }
  if (!isBuildable()) {
    throw HttpResponses.error(SC_INTERNAL_SERVER_ERROR, new IOException(getFullName() + " is not buildable"));
  }
  Hudson.getInstance().getQueue().schedule(this, getDelay(req), getBuildCause(req));
  rsp.forwardToPreviousPage(req);
}

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

/**
 * Schedules a new build command.
 */
public void doBuild( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
  BuildAuthorizationToken.checkPermission(this, authToken, req, rsp);
  // if a build is parameterized, let that take over
  ParametersDefinitionProperty pp = getProperty(ParametersDefinitionProperty.class);
  if (pp != null) {
    pp._doBuild(req,rsp);
    return;
  }
  if (!isBuildable())
    throw HttpResponses.error(SC_INTERNAL_SERVER_ERROR,new IOException(getFullName()+" is not buildable"));
  Hudson.getInstance().getQueue().schedule(this, getDelay(req), getBuildCause(req));
  rsp.forwardToPreviousPage(req);
}

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

/**
 * Schedules a new build command.
 */
public void doBuild( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
  BuildAuthorizationToken.checkPermission(this, authToken, req, rsp);
  // if a build is parameterized, let that take over
  ParametersDefinitionProperty pp = getProperty(ParametersDefinitionProperty.class);
  if (pp != null) {
    pp._doBuild(req,rsp);
    return;
  }
  if (!isBuildable())
    throw HttpResponses.error(SC_INTERNAL_SERVER_ERROR,new IOException(getFullName()+" is not buildable"));
  Hudson.getInstance().getQueue().schedule(this, getDelay(req), getBuildCause(req));
  rsp.forwardToPreviousPage(req);
}

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

/**
 * Schedules a new build command.
 */
public void doBuild(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
  BuildAuthorizationToken.checkPermission(this, authToken, req, rsp);
  
  if (!isBuildable()) {
    throw HttpResponses.error(SC_INTERNAL_SERVER_ERROR, new IOException(getFullName() + " is not buildable"));
  }
  // if a build is parameterized, let that take over
  ParametersDefinitionProperty pp = getProperty(ParametersDefinitionProperty.class);
  if (pp != null) {
    synchronized(buildSchedulelock) {
      pp.setOwner(this);
      pp._doBuild(req, rsp);
    }
    return;
  }
  Hudson.getInstance().getQueue().schedule(this, getDelay(req), getBuildCause(req));
  rsp.forwardToPreviousPage(req);
}

相关文章

微信公众号

最新文章

更多

AbstractProject类方法