Search in sources :

Example 1 with GtRepository

use of org.jreleaser.sdk.gitea.api.GtRepository in project jreleaser by jreleaser.

the class GiteaReleaser method maybeCreateRepository.

@Override
public Repository maybeCreateRepository(String owner, String repo, String password) throws IOException {
    org.jreleaser.model.Gitea gitea = resolveGiteaFromModel();
    context.getLogger().debug(RB.$("git.repository.lookup"), owner, repo);
    Gitea api = new Gitea(context.getLogger(), gitea.getApiEndpoint(), password, gitea.getConnectTimeout(), gitea.getReadTimeout());
    GtRepository repository = api.findRepository(owner, repo);
    if (null == repository) {
        repository = api.createRepository(owner, repo);
    }
    return new Repository(resolveRepositoryKind(), owner, repo, repository.getHtmlUrl(), repository.getCloneUrl());
}
Also used : Repository(org.jreleaser.model.releaser.spi.Repository) GtRepository(org.jreleaser.sdk.gitea.api.GtRepository) GtRepository(org.jreleaser.sdk.gitea.api.GtRepository)

Aggregations

Repository (org.jreleaser.model.releaser.spi.Repository)1 GtRepository (org.jreleaser.sdk.gitea.api.GtRepository)1