Ain Tohvri
Ain Tohvri

Reputation: 3035

Capistrano deploy from Git HTTP repo

Has anyone experience with Capistrano deployment from a Git repository over HTTP?

The following deploy.rb is not working:

set :repository,  'http://git.repository-domain.com:4442/git/repo.git'
set :scm_username, "git_username"
set :scm_password, "git_password"
set :scm, :git

It is working if you pass a repository in as following though:

set :repository,  'http://git_username:[email protected]:4442/git/repo.git'

The latter only works as long as either the username or password have no special chars. URL-encoding those chars will result in a failure.

UPDATE: a more precise description of the problem is available in the ticket at https://github.com/capistrano/capistrano/issues/384

Upvotes: 8

Views: 10786

Answers (1)

Ain Tohvri
Ain Tohvri

Reputation: 3035

Capistrano Git HTTPS authentication will be resolved in Capistrano 3 where you can set repository and its credentials with:

set :repo_url, 'https://git.repository-domain.com:4442/git/repo.git'
set :git_http_username, 'username'
set :git_http_password, 'password'

Also, what already works in Capistrano 3, is the username:password in the repository URL even if the password includes special characters:

set :repo_url, 'https://ain:[email protected]:4442/git/repo.git'

For more up-to-date info see https://github.com/capistrano/capistrano

Upvotes: 20

Related Questions