public RunnablePipelineContainer(String imageId, String branchName) { this.imageId = imageId; this.branchName = branchName; this.repairnatorConfig = RepairnatorConfig.getInstance(); }
public InspectProcessDuration(InspectBuilds inspectBuilds, InspectJobs inspectJobs, BuildRunner buildRunner) { this.duration = RepairnatorConfig.getInstance().getDuration(); this.inspectBuilds = inspectBuilds; this.inspectJobs = inspectJobs; this.buildRunner = buildRunner; }
public static RepairnatorConfig getInstance() { if (instance == null) { instance = new RepairnatorConfig(); } return instance; }
public static List<NotifierEngine> initEmailSummaryEngines(Logger logger) { List<NotifierEngine> summaryEngines = new ArrayList<>(); RepairnatorConfig config = RepairnatorConfig.getInstance(); if(config.getSmtpServer() != null && config.getSummaryFrequency() != null && config.getNotifySummary() != null) { logger.info("The summary email engine will be used."); summaryEngines.add(new EmailNotifierEngine(config.getNotifySummary(), config.getSmtpServer(), config.getSmtpPort(), config.isSmtpTLS(), config.getSmtpUsername(), config.getSmtpPassword())); } else { logger.info("The summary email engine will not be used."); } return summaryEngines; }
private void setConfigurationFromProperties(Properties properties, RepairnatorConfig config) throws RepairnatorConfigException { try { config.setPush(Boolean.parseBoolean(properties.getProperty("push"))); config.setWorkspacePath(properties.getProperty("workspacePath")); config.setZ3solverPath(properties.getProperty("z3path")); config.setOutputPath(properties.getProperty("jsonOutputPath")); config.setPushRemoteRepo(properties.getProperty("pushRemoteRepo")); } catch (Exception e) { logger.error("Error while setting config values from properties."); throw new RepairnatorConfigException("Error while setting config values from properties.", e); } }
public BuildRunner(RTScanner rtScanner) { LOGGER.info("Init build runner"); super.setDockerOutputDir(RepairnatorConfig.getInstance().getLogDirectory()); super.setRunId(RepairnatorConfig.getInstance().getRunId()); super.setEngines(rtScanner.getEngines()); }
public void initRunner() { this.setDockerImageName(RepairnatorConfig.getInstance().getDockerImageName()); this.initExecutorService(RepairnatorConfig.getInstance().getNbThreads()); }
public static PersonIdent getCommitterIdent() { if (committerIdent == null) { committerIdent = new PersonIdent(RepairnatorConfig.getInstance().getGithubUserName(), RepairnatorConfig.getInstance().getGithubUserEmail()); } return committerIdent; }
public ProjectScanner(Date lookFromDate, Date lookToDate, String runId) { this.lookFromDate = lookFromDate; this.lookToDate = lookToDate; this.slugs = new HashSet<String>(); this.repositories = new HashSet<Repository>(); this.runId = runId; this.jTravis = RepairnatorConfig.getInstance().getJTravis(); this.logger.info("Look from " + Utils.formatCompleteDate(this.lookFromDate) + " to " + Utils.formatCompleteDate(this.lookToDate)); }
private void initNotifiers() { if (this.config.isNotifyEndProcess()) { List<NotifierEngine> notifierEngines = LauncherUtils.initNotifierEngines(LOGGER); this.endProcessNotifier = new EndProcessNotifier(notifierEngines, LauncherType.REALTIME.name().toLowerCase()+" (runid: "+this.config.getRunId()+")"); } }
public InspectJobs(RTScanner scanner) { this.rtScanner = scanner; this.sleepTime = RepairnatorConfig.getInstance().getJobSleepTime(); }
public InspectBuilds(RTScanner rtScanner) { this.rtScanner = rtScanner; this.sleepTime = RepairnatorConfig.getInstance().getBuildSleepTime(); this.maxSubmittedBuilds = RepairnatorConfig.getInstance().getMaxInspectedBuilds(); this.watchedBuildSerializer = new WatchedBuildSerializer(this.rtScanner.getEngines(), this.rtScanner); }
public GitHub getGithub() throws IOException { return this.getJTravis().getGithub(); }
private void processOutput(Map<ScannedBuildStatus, List<BuildToBeInspected>> listOfBuilds) { if (this.config.getOutputPath() != null && !this.config.getOutputPath().isEmpty()) { this.printToFile(listOfBuilds); } else { this.printToStdout(listOfBuilds); } }
public JTravis getJTravis() { return JTravis.builder().setGithubToken(this.getGithubToken()).build(); }
public void readFromFile() throws RepairnatorConfigException { RepairnatorConfigReader configReader = new RepairnatorConfigReader(); configReader.readConfigFile(this); }
public PushProcessEnd(ProjectInspector inspector) { super(inspector, false); this.remoteRepoUrl = this.getConfig().getPushRemoteRepo(); this.branchName = this.getInspector().getRemoteBranchName(); }
private void checkNextBuildId(JSAP jsap) { if (this.getConfig().getNextBuildId() == InputBuildId.NO_PATCH) { System.err.println("A pair of builds needs to be provided in BEARS mode."); LauncherUtils.printUsage(jsap, LauncherType.PIPELINE); } }
public RepairnatorConfig getConfig() { return RepairnatorConfig.getInstance(); }
private RepairnatorConfig getConfig() { return RepairnatorConfig.getInstance(); }