Hello,
where I found repositories data? repositoryUrl, current branch, etc. A write plugin and I have:
//context == TaskContext final BuildContext parentBuildContext = Optional.ofNullable(context.getBuildContext().getParentBuildContext()) .orElseThrow(() -> new RuntimeException("No parent context!")); final List<PlanRepositoryDefinition> repositories = parentBuildContext.getVcsRepositories(); for (final PlanRepositoryDefinition repo : repositories) { //repo.getBranch().getVcsBranch() // I have name or displayName methods }
I need repository url and other informations.
Someone can help me?
Community moderators have prevented the ability to post new answers.
It depends on the repository type. Look at this:
Map<String, String> serverConfig = repo.getVcsLocation().getConfiguration();
The exact key you need to pull out of the map depends on what repository type it is.
It works only for git repository. Configuration map for bitbucket/stash is empty.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.