05/10/2013, 01:50
|
| | | Fecha de Ingreso: enero-2008 Ubicación: Donostia - San Sebastián
Mensajes: 756
Antigüedad: 16 años, 10 meses Puntos: 32 | |
Respuesta: Deploy con Capifony en servidores pequeños
Código:
set :application, "dominio.com"
set :domain, "server.dominio.com"
set :deploy_to, "/home/user/dominio.com"
set :user, "user"
set :password, "password"
set :app_path, "app"
#Sudo
set :use_sudo, false
set :repository, "file:///c/wamp/www/proyecto.git"
set :scm, :git
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `subversion`, `mercurial`, `perforce`, or `none`
#Configuración de actualización en servidor
set :deploy_via, :copy
set :update_vendors, false
set :use_composer, true
set :shared_files, ["app/config/parameters.yml", "web/.htaccess"]
set :shared_children, [app_path + "/logs", web_path + "/uploads", "vendor"]
after "deploy:update", "deploy:chmodcache", "deploy:cleanup", "upload_parameters"
after "deploy:setup", "upload_parameters"
#Configuración de actualización en local
#set :deploy_via, :capifony_copy_local
#set :use_composer_tmp, true
#set :use_composer, true
set :model_manager, "doctrine"
# Or: `propel`
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 :dump_assetic_assets, true
#FUNCIONES
#Permisos de la carpeta cache
namespace :deploy do
desc "Permisos de la carpeta cache"
task :chmodcache do
run("chmod -R 777 #{current_path}/app/cache")
end
end
#Permisos de la carpeta logs
namespace :deploy do
desc "Permisos de la carpeta logs"
task :chmodlogs do
run("chmod -R 777 #{current_path}/app/logs")
end
end
#Subida de fichero parameters.yml
task :upload_parameters do
origin_file = "app/config/parameters.yml"
destination_file = shared_path + "/app/config/parameters.yml" # Notice the shared_path
try_sudo "mkdir -p #{File.dirname(destination_file)}"
top.upload(origin_file, destination_file)
end
|