Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'capistrano/ext/multistage'
- require 'bundler/capistrano'
- set :application, "ftpmanager"
- set :stages, %w(production)
- set :default_stage, "production"
- set :keep_releases, 2
- set :application, "ftpmanager"
- set :scm, "git"
- set :repository, "git@github.com:develon/ftpmanager.git"
- set :deploy_via, :remote_cache
- set :scm_verbose, true
- set :branch, "refactory"
- set :user, "deploy"
- set :use_sudo, false
- set :deploy_to, "/space/apache/htdocs/#{application}"
- namespace :deploy do
- task :start do ; end
- task :stop do ; end
- task :restart, :roles => :app, :except => { :no_release => true } do
- run "touch #{File.join(current_path,'tmp','restart.txt')}"
- end
- namespace :web do
- task :disable, :roles => :web do
- on_rollback { rm "#{shared_path}/system/maintenance.html" }
- require 'erb'
- put ERB.new(File.read("app/views/layouts/maintenance.html.erb")).result(binding), "#{shared_path}/system/maintenance.html", :mode => 0644
- end
- end
- end
- namespace :configuration do
- desc "Create dir in shared path"
- task :default_dir do
- run "mkdir #{shared_path}/config"
- end
- desc "Create default database.yml"
- task :default_database_yml do
- file = <<-EOF
- development:
- adapter: mysql2
- encoding: utf8
- database: #{application}
- pool: 12
- username: db
- password: ******
- test:
- adapter: mysql2
- encoding: utf8
- database: #{application}
- pool: 5
- username: db
- password: ***
- production:
- adapter: mysql2
- encoding: utf8
- database: #{application}
- pool: 5
- username: db
- password: ****
- EOF
- put file, "#{shared_path}/config/database.yml"
- end
- desc "Symlinks the database config files to current path"
- task :symlink_config do
- ["database.yml","ldap.yml"].each do |link|
- run "ln -nfs #{shared_path}/config/#{link} #{release_path}/config/#{link}"
- end
- end
- end
- namespace :less do
- desc 'Update stylesheets generated by LESS CSS'
- task :update do
- run "lessc #{latest_release}/public/stylesheets/style.less"
- end
- end
- #after "deploy:update_code"
- #after "deploy:symlink", "less:update"
- after "deploy:setup", "configuration:default_dir"
- after "deploy:setup", "configuration:default_database_yml"
- after "deploy:update_code", "configuration:symlink_config"
- after "deploy:update", "deploy:cleanup"
Add Comment
Please, Sign In to add comment