Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 498
Ain Tohvri Avatar asked Jun 08 '26 16:06

Ain Tohvri


1 Answers

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

like image 154
Ain Tohvri Avatar answered Jun 11 '26 05:06

Ain Tohvri



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!