Answer the question
In order to leave comments, you need to log in
How to deploy a project to the server using git pull?
I keep all my projects on github. After a bunch of commits, you usually want to upload the already installed version to the production server so that users can test the latest changes. Now I do it by hand.
How can this process be automated?
If it's just a server with git, then everything is clear. We initialize the repository on the server and push it there. But how to dodge in order to send the same changes to the production server in parallel to the github?
Answer the question
In order to leave comments, you need to log in
I would recommend an external deployment system like github.com/capistrano/capistrano
Here is my config for a symfony2 project:
set :application, "appname"
set :deploy_to, "/var/www/#{application}"
set :repository, "[email protected]:vslinko/#{application}.git"
set :scm, :git
set :shared_files, ["app/config/parameters.yml"]
set :shared_children, ["app/logs", "web/uploads", "vendor"]
set :asset_children, []
set :user, "www-data"
set :use_composer, true
set :update_vendors, false
set :domain, "symfony.slinko.me"
role :app, domain
task :production do
set :domain, "appname.com"
role :app, domain
end
cap deploy
on the test server, and cap production deploy
on the working
Nothing needs to be pushed to the combat server. You are confusing processes.
Repository one. You have it on github. Push _only_ there.
Pull (git pull) both to the local for work, and to test and production.
That is, in combat, to deploy the project:
git clone ....
git pull
But how to dodge in order to send the same changes to the production server in parallel to the github?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question