Search in sources :

Example 1 with GitBasedRepositoryConfiguration

use of org.eclipse.winery.common.configuration.GitBasedRepositoryConfiguration in project winery by eclipse.

the class RepositoryFactory method getRepository.

/**
 * Generates a new IRepository working on the specified path.
 */
public static IRepository getRepository(Path path) {
    Objects.requireNonNull(path);
    GitBasedRepositoryConfiguration config = new GitBasedRepositoryConfiguration(false, new FileBasedRepositoryConfiguration(path));
    try {
        reconfigure(config);
    } catch (IOException | GitAPIException e) {
        LOGGER.error("Error while reconfiguring the repository", e);
    }
    return repository;
}
Also used : GitAPIException(org.eclipse.jgit.api.errors.GitAPIException) GitBasedRepositoryConfiguration(org.eclipse.winery.common.configuration.GitBasedRepositoryConfiguration) FileBasedRepositoryConfiguration(org.eclipse.winery.common.configuration.FileBasedRepositoryConfiguration) IOException(java.io.IOException)

Example 2 with GitBasedRepositoryConfiguration

use of org.eclipse.winery.common.configuration.GitBasedRepositoryConfiguration in project winery by eclipse.

the class AbstractGitResolver method createRepository.

@Override
public GitBasedRepository createRepository(File repositoryLocation) throws IOException, GitAPIException {
    FileBasedRepositoryConfiguration compositeConfiguration = new FileBasedRepositoryConfiguration(Paths.get(repositoryLocation.toString()));
    GitBasedRepositoryConfiguration configuration = new GitBasedRepositoryConfiguration(false, repositoryUrl, repositoryBranch, compositeConfiguration);
    return new GitBasedRepository(configuration, RepositoryFactory.createXmlOrYamlRepository(compositeConfiguration, repositoryLocation.toPath()));
}
Also used : GitBasedRepositoryConfiguration(org.eclipse.winery.common.configuration.GitBasedRepositoryConfiguration) FileBasedRepositoryConfiguration(org.eclipse.winery.common.configuration.FileBasedRepositoryConfiguration) GitBasedRepository(org.eclipse.winery.repository.backend.filebased.GitBasedRepository)

Example 3 with GitBasedRepositoryConfiguration

use of org.eclipse.winery.common.configuration.GitBasedRepositoryConfiguration in project winery by eclipse.

the class TenantRepository method initTenantRepository.

public IRepository initTenantRepository(String tenantName) throws GitAPIException, IOException {
    FileBasedRepositoryConfiguration fileBasedConfig = new FileBasedRepositoryConfiguration(repositoryRoot.resolve(tenantName));
    IRepository tenantRepo = this.createRepo(new GitBasedRepositoryConfiguration(false, fileBasedConfig));
    repositories.put(tenantName, tenantRepo);
    return tenantRepo;
}
Also used : GitBasedRepositoryConfiguration(org.eclipse.winery.common.configuration.GitBasedRepositoryConfiguration) FileBasedRepositoryConfiguration(org.eclipse.winery.common.configuration.FileBasedRepositoryConfiguration) IRepository(org.eclipse.winery.repository.backend.IRepository)

Example 4 with GitBasedRepositoryConfiguration

use of org.eclipse.winery.common.configuration.GitBasedRepositoryConfiguration in project winery by eclipse.

the class RepositoryFactory method reconfigure.

/**
 * Reconfigures based on Environment
 */
public static void reconfigure() throws Exception {
    final GitBasedRepositoryConfiguration gitBasedRepositoryConfiguration = Environments.getInstance().getGitBasedRepositoryConfiguration();
    reconfigure(gitBasedRepositoryConfiguration);
}
Also used : GitBasedRepositoryConfiguration(org.eclipse.winery.common.configuration.GitBasedRepositoryConfiguration)

Aggregations

GitBasedRepositoryConfiguration (org.eclipse.winery.common.configuration.GitBasedRepositoryConfiguration)4 FileBasedRepositoryConfiguration (org.eclipse.winery.common.configuration.FileBasedRepositoryConfiguration)3 IOException (java.io.IOException)1 GitAPIException (org.eclipse.jgit.api.errors.GitAPIException)1 IRepository (org.eclipse.winery.repository.backend.IRepository)1 GitBasedRepository (org.eclipse.winery.repository.backend.filebased.GitBasedRepository)1