private BranchTemplateSyncResults doSyncTemplateDefinition(ID branchId, JobRunListener listener) { // Loads the template definition listener.message("Loading template definition for %s", branchId); TemplateDefinition templateDefinition = getTemplateDefinition(branchId) .orElseThrow(() -> new BranchNotTemplateDefinitionException(branchId)); // Gets the source of the branch names to synchronise with Optional<TemplateSynchronisationSource<?>> templateSynchronisationSource = templateSynchronisationService.getSynchronisationSource( templateDefinition.getSynchronisationSourceConfig().getId() ); if (templateSynchronisationSource.isPresent()) { // Using the source return syncTemplateDefinition(branchId, templateDefinition, templateSynchronisationSource.get(), listener); } else { return BranchTemplateSyncResults.empty(); } }
buildNameFilter); logger.info("[artifactory-sync] {}", log); listener.message(log);
protected BranchTemplateSyncResult syncTemplateDefinition(Branch templateBranch, TemplateDefinition templateDefinition, String sourceName, JobRunListener listener) { listener.message("Sync. %s --> %s", templateBranch.getName(), sourceName); ); } else { listener.message("%s exists - updating", branchName); updateTemplateInstance( sourceName, listener.message("%s does not exists - creating and updating", branchName); Branch instance = createBranchForTemplateInstance(templateBranch, sourceName); updateTemplateInstance(
protected <T> BranchTemplateSyncResults syncTemplateDefinition( ID branchId, TemplateDefinition templateDefinition, TemplateSynchronisationSource<T> templateSynchronisationSource, JobRunListener listener) { // Parsing of the configuration data T config = templateSynchronisationSource.parseConfig(templateDefinition.getSynchronisationSourceConfig().getData()); // Loads the branch Branch templateBranch = structureService.getBranch(branchId); // Logging listener.message("Getting template sync. sources from %s", templateSynchronisationSource.getName()); // Getting the list of names List<String> sourceNames = templateSynchronisationSource.getBranchNames(templateBranch, config); // Sync on those names return syncTemplateDefinition(templateBranch, templateDefinition, sourceNames, listener); }
SVNRevision toRevision = SVNRevision.create(to); IndexationHandler handler = new IndexationHandler(repository, revision -> runListener.message( "Indexation on %s is running (%d to %d - at %d - %d%%)", repository.getConfiguration().getName(),
buildName); logger.debug("[artifactory-sync] {}", log); listener.message(log);
runListener.message( "Running build synchronisation from SVN for branch %s/%s: %d build(s) created", branch.getProject().getName(),