Package org.eclipse.jgit.transport

Examples of org.eclipse.jgit.transport.CredentialsProvider


    if (log.isDebugEnabled()) {
      log.debug("Creating git repo folder structure  ");
    }   
   
    String parentDirName = "/tmp/" + UUID.randomUUID().toString();
    CredentialsProvider credentialsProvider =
                                              new UsernamePasswordCredentialsProvider(
                                                                                      System.getProperty(CartridgeConstants.INTERNAL_GIT_USERNAME),
                                                                                      System.getProperty(CartridgeConstants.INTERNAL_GIT_PASSWORD).toCharArray());
    // Clone
    // --------------------------
View Full Code Here


      log.debug("External repo validation enabled");
    }

    // This assumes running on Linux.
    String parentDirName = "/tmp/" + UUID.randomUUID().toString();
    CredentialsProvider credentialsProvider = null;
    if (repoUsername != null && repoUsername.trim().length() > 0 && repoPassword != null
        && repoPassword.trim().length() > 0) {
      if (log.isDebugEnabled()) {
        log.debug("External repo credentails are passed: " + repoUsername);
      }
View Full Code Here

      @Override
      protected void configure(OpenSshConfig.Host hc, Session session) {
        session.setConfig("StrictHostKeyChecking", "no");
        session.setConfig("IdentityFile", sshKey);
       
        CredentialsProvider provider = new CredentialsProvider() {
          @Override
          public boolean isInteractive() {
            return false;
          }
View Full Code Here

    }

    public static Iterable<PushResult> push( ScmLogger logger, Git git, GitScmProviderRepository repo, RefSpec refSpec )
        throws GitAPIException, InvalidRemoteException, TransportException
    {
        CredentialsProvider credentials = JGitUtils.prepareSession( logger, git, repo );
        Iterable<PushResult> pushResultList =
            git.push().setCredentialsProvider( credentials ).setRefSpecs( refSpec ).call();
        for ( PushResult pushResult : pushResultList )
        {
            Collection<RemoteRefUpdate> ru = pushResult.getRemoteUpdates();
View Full Code Here

        Git git = null;
        try
        {
            git = Git.open( fileSet.getBasedir() );
            CredentialsProvider credentials =
                JGitUtils.prepareSession( getLogger(), git, (GitScmProviderRepository) repo );

            List<ScmFile> list = new ArrayList<ScmFile>();
            Collection<Ref> lsResult = git.lsRemote().setCredentialsProvider( credentials ).call();
            for ( Ref ref : lsResult )
View Full Code Here

                WindowCacheConfig cfg = new WindowCacheConfig();
                cfg.setPackedGitMMAP( false );
                cfg.install();

                // no git repo seems to exist, let's clone the original repo
                CredentialsProvider credentials = JGitUtils.getCredentials( (GitScmProviderRepository) repo );
                getLogger().info( "cloning [" + branch + "] to " + fileSet.getBasedir() );
                git = Git.cloneRepository().setURI( repository.getFetchUrl() ).setCredentialsProvider( credentials ).setBranch( branch ).setDirectory( fileSet.getBasedir() ).setProgressMonitor( monitor ).call();
            }

            JGitRemoteInfoCommand remoteInfoCommand = new JGitRemoteInfoCommand();
            remoteInfoCommand.setLogger( getLogger() );
            RemoteInfoScmResult result = remoteInfoCommand.executeRemoteInfoCommand( repository, fileSet, null );

            if(git == null) {
                git = Git.open( fileSet.getBasedir() );
            }
           
            if ( fileSet.getBasedir().exists() && new File( fileSet.getBasedir(), ".git" ).exists()
                && result.getBranches().size() > 0 )
            {
                // git repo exists, so we must git-pull the changes
                CredentialsProvider credentials = JGitUtils.prepareSession( getLogger(), git, repository );

                if ( version != null && StringUtils.isNotEmpty( version.getName() ) && ( version instanceof ScmTag ) )
                {
                    // A tag will not be pulled but we only fetch all the commits from the upstream repo
                    // This is done because checking out a tag might not happen on the current branch
View Full Code Here

        GitScmProviderRepository repo = (GitScmProviderRepository) repository;
        Git git = null;
        try
        {
            git = Git.open( fileSet.getBasedir() );
            CredentialsProvider credentials = JGitUtils.getCredentials( repo );

            LsRemoteCommand lsCommand =
                git.lsRemote().setRemote( repo.getPushUrl() ).setCredentialsProvider( credentials );

            Map<String, String> tag = new HashMap<String, String>();
View Full Code Here

    if (log.isDebugEnabled()) {
      log.debug("Creating git repo folder structure  ");
    }   
   
    String parentDirName = "/tmp/" + UUID.randomUUID().toString();
    CredentialsProvider credentialsProvider =
                                              new UsernamePasswordCredentialsProvider(
                                                                                      System.getProperty(CartridgeConstants.INTERNAL_GIT_USERNAME),
                                                                                      System.getProperty(CartridgeConstants.INTERNAL_GIT_PASSWORD).toCharArray());
    // Clone
    // --------------------------
View Full Code Here

  private void testCommitterVerification(UserModel user, String displayName, String emailAddress, boolean expectedSuccess) throws Exception {

    delete(user);

    CredentialsProvider cp = new UsernamePasswordCredentialsProvider(user.username, user.password);

    // fork from original to a temporary bare repo
    File verification = new File(GitBlitSuite.REPOSITORIES, "refchecks/verify-committer.git");
    if (verification.exists()) {
      FileUtils.delete(verification, FileUtils.RECURSIVE);
View Full Code Here

  private void testMergeCommitterVerification(boolean expectedSuccess) throws Exception {
    UserModel user = getUser();

    delete(user);

    CredentialsProvider cp = new UsernamePasswordCredentialsProvider(user.username, user.password);

    // fork from original to a temporary bare repo
    File verification = new File(GitBlitSuite.REPOSITORIES, "refchecks/verify-committer.git");
    if (verification.exists()) {
      FileUtils.delete(verification, FileUtils.RECURSIVE);
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.transport.CredentialsProvider

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.