How to deploy Git (BitBucket) Capistrano to root directory

0 votes

I have setup Bitbucket & Capistrano and are testing deploying to remote servers but I am unable to deploy to a root directory, I've looked around but can't seem to find a way to change it.

e.g. /var/www/html/web_app/

but i get this

e.g. /var/www/html/releases/20161028093829

Any ideas. Thanks in advance.

version "3.6.1"

deploy.rb

set :application, "hunter"
set :repo_url, "git@bitbucket.org:*****.git"
# Default value for keep_releases is 5
set :keep_releases, 2

CAPFILE

require "capistrano/setup"

require "capistrano/rsync"

require "capistrano/deploy"

require "capistrano/scm/git" install_plugin Capistrano::SCM::Git

Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }

Rake::Task[:production].invoke

Can anyone help me with this?

thanks

Jul 12, 2018 in Git & GitHub by Atul
• 10,240 points
78 views

1 answer to this question.

0 votes

Here is what you should do.. The parameter responsible for defining the directory to deploy to is :deploy_to. So, in order to your Capistrano to deploy to /var/www/html/web_app/ you need to configure it accordingly.

Below set :keep_releases, 2 set the :deploy_to param to /var/www/html/web_app/. Your deploy.rb file will look like this:

set :application, "hunter"
set :repo_url, "git@bitbucket.org:*****.git"
# Default value for keep_releases is 5
set :keep_releases, 2
set :deploy_to, "/var/www/html/web_app"
answered Jul 12, 2018 by Damon Salvatore
• 5,490 points

Related Questions In Git & GitHub

0 votes
1 answer

How to do a re-merge into another branch in git

Seems like you want to rebase your ...READ MORE

answered May 7, 2018 in Git & GitHub by DareDev
• 6,810 points
96 views
0 votes
1 answer
0 votes
1 answer

How to view the nested workflow of a local git repository?

The ‘git log’ command is your closest ...READ MORE

answered Jul 4, 2018 in Git & GitHub by Sophie may
• 9,430 points
46 views
0 votes
1 answer

How to solve the ‘Git commit -a error’?

This happens when no editor is set. ...READ MORE

answered Jul 5, 2018 in Git & GitHub by Tyrion anex
• 8,280 points
37 views
0 votes
1 answer

How to forcefully commit a file to Git even if the file is ruled as unchanged?

This is simple, just follow the below ...READ MORE

answered Jul 11, 2018 in Git & GitHub by Sophie may
• 9,430 points
26 views
0 votes
1 answer

Is there a way to remove a directory from git repository?

This is simple, just follow the commands ...READ MORE

answered Jul 13, 2018 in Git & GitHub by Sophie may
• 9,430 points
30 views
+13 votes
2 answers
0 votes
1 answer