1

Currently, I try to set up Capistrano 3 with my Rails project. But I have a problem with the Git settings.

I have to use Visual Studio Team Foundation Server 2013 with Git support. The problem is that it only allows authentication using a HTTP request. There is no possibility to use a ssh key. https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/3801342-add-support-for-ssh-keys-as-alternate-authenticati

I do not want to store my password in ENV. How do I set up capistrano correctly to ask for the user and password?

For my old capistrano 2 config, I coded the complete steps my hand, because I had to use the old TFS without Git support.

By the way, I use Ubuntu for development.

Bjoernsen
  • 2,016
  • 1
  • 33
  • 41

1 Answers1

2

You can try and set a credential helper like git-credential-winstore in order to cache your credentials.

you would enter your login/password once per session only.

The OP Bjoernsen mentions in the comments:

I am using Capistrano 3. I have found a solution.

I asked our TFS admin to create a read only user account.
I added this user and its pw to my .bashrc and modified the git url.

It works. It is not the best solution, but the fastest :-)

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • That worked with Git Extension (http://stackoverflow.com/a/19030243/6309), not sure it works with TFS using libgit2. – VonC May 16 '14 at 06:24
  • I tried to set up git with `git config --global credential.helper "cache --timeout=3600"` The first time I cloned my Repo, git asked for the user and PW. The second time, it worked without user and password. But for 'bundle exec cap production deploy', it did not work. I still get `fatal: Authentication failed for ...` – Bjoernsen May 16 '14 at 06:36
  • @Bjoernsen is the bundle task executed with the same user account? A thread like this one (https://github.com/capistrano/capistrano/issues/384) ends up using... ssh url (not possible here) – VonC May 16 '14 at 06:40
  • The thread you mentioned uses Capistrano 2. I am using Capistrano 3. I have found a solution. I asked our TFS admin to create a read only user account. I added this user and its pw to my `.bashrc` and modified the git url. It works. It is not the best solution, but the fastest :-) – Bjoernsen May 16 '14 at 12:38
  • 1
    @Bjoernsen Ok. I have included your conclusion in the answer for more visibility. – VonC May 16 '14 at 12:43