本文整理了Java中jenkins.model.Jenkins.createProjectFromXML()
方法的一些代码示例,展示了Jenkins.createProjectFromXML()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jenkins.createProjectFromXML()
方法的具体详情如下:
包路径:jenkins.model.Jenkins
类名称: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
内容来源于网络,如有侵权,请联系作者删除!