I am using capistrano for the deployment of an PHP web application and we are having an internal gitlab server which is not accessible outside the network. I am trying to deploy using remote_cache as it is taking to much time if use it for copy. I have already checked This and This but not getting the desired result. I am trying the below code.
set :default_stage, "staging"
ssh_options[:forward_agent] = true
server "servername", :app, :web, :db, :primary => true
set :application, "appname"
set :scm, :git
set :repository, '.'
set :local_repository, "file://."
set :branch, "master"
default_run_options[:pty] = true
set :keep_releases, 2
set :user, 'username'
set :deploy_to, "/home/domain/public_html/test"
set :copy_cache, true
set :deploy_via, :remote_cache
set :copy_strategy, :export
set :use_sudo, false
set :copy_exclude, [".git", ".DS_Store", ".gitignore", ".gitmodules", "Capfile", "config/deploy.rb"]
What path to use for repository and local repository. Any suggestions how can I achieve this ? EDIT : Can I use my local repo for the remote cache.
How do you mean use you local repository for remote_cache?
:repository
is the url that the server being deployed to will use. So, if your Git server is running on the same server you are deploying to, you can set this to file:///path_to_repo
:local_repository
is the url that you will use to connect to the repo from your local machine that you are running the capistrano script on. You only need to set this if you :repository is a local path and you are running capistrano from a different machine.
Example:
set :repository, "file:///home/git/my_repo"
set :local_repository, "http://server_address/my_repo"
However, if, for example, you repo is on Github, then you should only set :repository
(DO NOT set :local_repository
)
set :repository, "[email protected]/your_account/your_repo.git"
Capistrano automatically creates a directory for keeping it's clone of the repo when using remote_cache deployment (shared/cached-copy).
Do you get an error when you run the script?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With