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());
}
Aggregations