/** * Lets try detect the github organisation level configuration for a project. * <p> * This lets us have a shared updatebot configuration across repositories within a github organisation * * @return null if it cannot be found */ protected static RepositoryConfig findGithubOrganisationConfig(Configuration configuration, File sourceDir) throws IOException { String gitCloneURL = null; try { gitCloneURL = GitHelpers.extractGitUrl(sourceDir); } catch (IOException e) { // ignore } return loadGithubOrganisationConfig(configuration, gitCloneURL); }
/** * Lets try detect the github organisation level configuration for a project. * <p> * This lets us have a shared updatebot configuration across repositories within a github organisation * * @return null if it cannot be found */ protected static RepositoryConfig findGithubOrganisationConfig(Configuration configuration, File sourceDir) throws IOException { String gitCloneURL = null; try { gitCloneURL = GitHelpers.extractGitUrl(sourceDir); } catch (IOException e) { // ignore } return loadGithubOrganisationConfig(configuration, gitCloneURL); }
public static String findGitUrl(Session session, File dir) { try { return GitHelpers.extractGitUrl(dir); } catch (IOException e) { session.getLogger().warn("Could not detect git url from directory: " + dir + ". " + e); return null; } }
/** * Returns the git repository configuration details * * @param repositoryConfig * @param sourceDir * @return * @throws IOException */ public static GitRepositoryConfig getGitHubRepositoryDetails(RepositoryConfig repositoryConfig, File sourceDir) throws IOException { String cloneUrl = GitHelpers.extractGitUrl(sourceDir); if (cloneUrl != null) { // lets remove any user/password if using HTTPS cloneUrl = GitHelper.removeUsernamePassword(cloneUrl); return repositoryConfig.getRepositoryDetails(cloneUrl); } return null; } }
/** * Returns the git repository configuration details * * @param repositoryConfig * @param sourceDir * @return * @throws IOException */ public static GitRepositoryConfig getGitHubRepositoryDetails(RepositoryConfig repositoryConfig, File sourceDir) throws IOException { String cloneUrl = GitHelpers.extractGitUrl(sourceDir); if (cloneUrl != null) { // lets remove any user/password if using HTTPS cloneUrl = GitHelper.removeUsernamePassword(cloneUrl); return repositoryConfig.getRepositoryDetails(cloneUrl); } return null; } }
if (config != null) { String configText = config.getContents(); gitUrlText = GitHelpers.extractGitUrl(configText);
if (config != null) { String configText = config.getContents(); gitUrlText = GitHelpers.extractGitUrl(configText);
gitUrl = GitHelpers.extractGitUrl(basedir);
url = GitHelpers.extractGitUrl(dir); } catch (IOException e) { throw new ParameterException("Could not find the git clone URL in " + dir + ". " + e, e);
url = GitHelpers.extractGitUrl(dir); } catch (IOException e) { throw new ParameterException("Could not find the git clone URL in " + dir + ". " + e, e);