jenkins.model.Jenkins.createProjectFromXML()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(173)

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

Jenkins.createProjectFromXML介绍

暂无

代码示例

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

private void verifyCompatibility(String resourceName, Class<? extends WorkspaceUpdater> expected) throws Exception {
  TopLevelItem item = r.jenkins.getItem("update");
  if (item != null) {
    item.delete();
  }
  AbstractProject job = (AbstractProject) r.jenkins.createProjectFromXML("update", getClass().getResourceAsStream(resourceName));
  assertEquals(expected, ((SubversionSCM)job.getScm()).getWorkspaceUpdater().getClass());
}

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

/**
 * Action when 'restore' button is pressed: Restore deleted project.
 *
 * @param req
 *            Incoming StaplerRequest
 * @param rsp
 *            Outgoing StaplerResponse
 * @throws IOException
 *             If something goes wrong
 */
public final void doRestore(StaplerRequest req, StaplerResponse rsp)
    throws IOException {
  getAccessControlledObject().checkPermission(Item.CONFIGURE);
  final String deletedName = req.getParameter("name");
  final String newName = deletedName.split("_deleted_")[0];
  final XmlFile configXml = getLastAvailableConfigXml(deletedName);
  final InputStream is = new ByteArrayInputStream(
      configXml.asString().getBytes("UTF-8"));
  final String calculatedNewName = findNewName(newName);
  final TopLevelItem project = getJenkins()
      .createProjectFromXML(calculatedNewName, is);
  // TODO: Casting here should be removed.
  ((FileHistoryDao) getHistoryDao()).copyHistoryAndDelete(deletedName,
      calculatedNewName);
  rsp.sendRedirect(getJenkins().getRootUrl() + project.getUrl());
}

代码示例来源:origin: io.fabric8.jenkins.plugins/openshift-sync

Job job = BuildTrigger.getDscp().getJobFromBuildConfigUid(buildConfig.getMetadata().getUid());
if (job == null) {
 jenkins.createProjectFromXML(
  jobName,
  jobStream

相关文章

Jenkins类方法