Package org.eclipse.egit.github.core

Examples of org.eclipse.egit.github.core.RepositoryId


   */
  @Override
  protected void deploy(Site site, File dest) throws MojoExecutionException,
      MojoFailureException {
   
    RepositoryId repository = getRepository(project, repositoryOwner, repositoryName);

    if (dryRun)
      info("Dry run mode, repository will not be modified");

    File outputDirectory = dest;
View Full Code Here


   * @throws MojoExecutionException
   */
  protected RepositoryId getRepository(final MavenProject project,
      final String owner, final String name)
      throws MojoExecutionException {
    RepositoryId repository = null;
    if(StringUtils.isNotBlank(name) && StringUtils.isNotBlank(owner)){
      repository = RepositoryId.create(owner, name);
    }else{
      throw new MojoExecutionException("No GitHub repository (owner and name) configured");
    }
    if (isDebug())
      debug(MessageFormat.format("Using GitHub repository {0}",
          repository.generateId()));
    return repository;
  }
View Full Code Here

  public GitHub() {
    super();
  }

  public void deploy(File outputDirectory, String destinationDirectory) throws GitHubException {
    RepositoryId repository = getRepository(repositoryOwner, repositoryName);
    if (dryRun){
      log.info("Dry run mode, repository will not be modified");
    }
   
    String[] paths = getPaths(outputDirectory);
View Full Code Here

   * @param name
   * @return non-null repository id
   * @throws MojoExecutionException
   */
  private RepositoryId getRepository(final String owner, final String name) throws GitHubException {
    RepositoryId repository = null;
    if(StringUtils.isNotBlank(name) && StringUtils.isNotBlank(owner)){
      repository = RepositoryId.create(owner, name);
    }else{
      throw new GitHubException("No GitHub repository (owner and name) configured");
    }
    if (log.isDebugEnabled()){
      log.debug(MessageFormat.format("Using GitHub repository {0}", repository.generateId()));
    }
    return repository;
  }
View Full Code Here

    public String confirm(@PathVariable("owner") String repoOwner, @PathVariable("repo") String repoName, Map<String, Object> map) throws Exception
    {
      try
      {       
        // Repository name
        RepositoryId repoId = RepositoryId.create(repoOwner, repoName);
        map.put("repositoryName", repoId.generateId());
       
        // Display user info
        ForceServiceConnector forceConnector = new ForceServiceConnector(ForceServiceConnector.getThreadLocalConnectorConfig());
        map.put("userContext", forceConnector.getConnection().getUserInfo());
               
View Full Code Here

          xmlOutputStream.close();
          packageManifestXml = new String(packageBaos.toByteArray())
        }
       
        // Download the Repository as an archive zip
      RepositoryId repoId = RepositoryId.create(repoOwner, repoName);
        ContentsServiceEx contentService = new ContentsServiceEx(client);
        ZipInputStream zipIS = contentService.getArchiveAsZip(repoId);
       
    // Dynamically generated package manifest?
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
View Full Code Here

  /**
   * Test repository extraction from SCM anonymous Git URL
   */
  @Test
  public void extractFromAnonymousUrl() {
    RepositoryId repo = RepositoryUtils
        .extractRepositoryFromScmUrl("scm:git:git://github.com/owner/project.git");
    assertNotNull(repo);
    assertEquals("owner", repo.getOwner());
    assertEquals("project", repo.getName());
    assertEquals("owner/project", repo.generateId());
  }
View Full Code Here

  /**
   * Test repository extraction from SCM SSH Git URL
   */
  @Test
  public void extractFromSshUrl() {
    RepositoryId repo = RepositoryUtils
        .extractRepositoryFromScmUrl("scm:git:git@github.com:owner/project.git");
    assertNotNull(repo);
    assertEquals("owner", repo.getOwner());
    assertEquals("project", repo.getName());
    assertEquals("owner/project", repo.generateId());
  }
View Full Code Here

  }

    @Test
    public void extractRepositoryFromEmptyProject() {
        MavenProject project = Mockito.mock(MavenProject.class);
        RepositoryId repositoryId = RepositoryUtils.getRepository(project, null, null);
        assertThat(repositoryId).isNull();
    }
View Full Code Here

    @Test
    public void extractRepositoryFromEmptyProjectWithUrl() {
        MavenProject project = Mockito.mock(MavenProject.class);
        when(project.getUrl()).thenReturn("https://github.com/nanoko-project/coffee-mill-maven-plugin");
        RepositoryId repositoryId = RepositoryUtils.getRepository(project, null, null);
        assertThat(repositoryId).isNotNull();
        assertThat(repositoryId.getName()).isEqualTo("coffee-mill-maven-plugin");
        assertThat(repositoryId.getOwner()).isEqualTo("nanoko-project");
    }
View Full Code Here

TOP

Related Classes of org.eclipse.egit.github.core.RepositoryId

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.