try {
if (createPatch()) {
RequestManager requestManager = browserPanel.getJenkinsManager();
String selectedJobName = (String) jobsList.getSelectedItem();
if (selectedJobName != null && !selectedJobName.isEmpty()) {
Job selectedJob = browserPanel.getJob(selectedJobName);
if (selectedJob != null) {
if (selectedJob.hasParameters()) {
if (selectedJob.hasParameter(UploadPatchToJob.PARAMETER_NAME)) {
JenkinsAppSettings settings = JenkinsAppSettings.getSafeInstance(project);
Map<String, VirtualFile> files = new HashMap<String, VirtualFile>();
VirtualFile virtualFile = UploadPatchToJob.prepareFile(browserPanel, LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(FILENAME)), settings, selectedJob);
if (virtualFile != null && virtualFile.exists()) {
files.put(UploadPatchToJob.PARAMETER_NAME, virtualFile);
requestManager.runBuild(selectedJob, settings, files);
//browserPanel.loadSelectedJob();
browserPanel.notifyInfoJenkinsToolWindow(HtmlUtil.createHtmlLinkMessage(
selectedJob.getName() + " build is on going",
selectedJob.getUrl())
);
watchJob(browserPanel, selectedJob);
} else {
throw new ConfigurationException(String.format("File \"%s\" not found", virtualFile.getPath()));
}
} else {
throw new ConfigurationException(String.format("Job \"%s\" should has parameter with name \"%s\"", selectedJob.getName(), UploadPatchToJob.PARAMETER_NAME));
}
} else {
throw new ConfigurationException(String.format("Job \"%s\" has no parameters", selectedJob.getName()));
}
}
}
}
} catch (Exception e) {