-
Install Git for Windows – download and install msysGit from official Git site : http://git-scm.com/download/win
-
Install Ruby – download and install Rubyinstall for Windows : http://rubyinstaller.org/downloads/
-
Install Capifony – open a Windows command prompt with Ruby – install Capifony with this command :
gem install capifony- Setup local project
cd path/to/your/project
capifony .- Configure to deploy
– Edit ./app/config/deploy.rb file :
set :application, "myappli"
set :domain, "mydomain.com"
set :user, "username"
set :use_sudo, false
set :repository, "ssh://#{domain}:/var/repo/#{application}.git"
set :scm, :git
set :deploy_to, "/var/www/#{application}"
set :app_path, "app"
set :model_manager, "doctrine"
role :web, domain # Your HTTP server, Apache/etc
role :app, domain # This may be the same as your `Web` server
role :db, domain, :primary => true # This is where Symfony2 migrations will run
set :keep_releases, 3
logger.level = Logger::MAX_LEVEL
set :shared_files, ["app/config/parameters.yml"]
set :shared_children, [app_path + "/logs", web_path + "/uploads", "vendor"]
set :use_composer, true
set :update_vendors, true
# Symfony2 >= 2.1
before 'symfony:composer:update', 'symfony:copy_vendors'
namespace :symfony do
desc "Copy vendors from previous release"
task :copy_vendors, :except => { :no_release => true } do
if Capistrano::CLI.ui.agree("Do you want to copy last release vendor dir then do composer install ?: (y/N)")
capifony_pretty_print "--> Copying vendors from previous release"
run "cp -a #{previous_release}/vendor #{latest_release}/"
capifony_puts_ok
end
end
end- Setup production server – run this command on local project directory :
cap deploy:setup– create server side "parameters.yml" in ./shared/app/config/ folder containing at least this parameter :
# /var/www/myappli/shared/app/config/parameters.yml
parameters:
#...
secret: ThisTokenIsNotSoSecretChangeIt- Check if everything is ok to deploy
cap deploy:check- Deploy it !
cap deploy