private void createBranch( final EnrichmentContext context, final ExecutionEnrichment enrichment, final URI repositoryLocation, final String branchName) { final URI branchResource = enrichment.branchResource().get(); this.scmService.createBranch( CreateBranchCommand. builder(). withRepositoryLocation(repositoryLocation). withBranchName(branchName). withResource(branchResource). build()); context.setBranchResource(branchResource); LOGGER.debug("Created branch {} ({}) in repository {}",branchName,branchResource,repositoryLocation); }
private static void createBuild(final BuildRepository repository, final Build build, final Date createdOn, final String description, final SourceCodeManagementService scmService) { build.setCreatedOn(after(createdOn)); build.setDescription(description); build.setCodebase(new Codebase(build.buildId().resolve("repository.git"),"master")); scmService.createRepository( CreateRepositoryCommand. builder(). withRepositoryLocation(build.codebase().location()). withResource(build.buildId().resolve("scm/repo/")). build()); scmService.createBranch( CreateBranchCommand. builder(). withRepositoryLocation(build.codebase().location()). withBranchName(build.codebase().branchName()). withResource(build.buildId().resolve("scm/repo/master/")). build()); repository.add(build); }