Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ==============================================================
- # SET's
- # ==============================================================
- default_run_options[:pty] = true
- set :repository, "ENDEREÇO_GITHUB"
- set :scm, "git"
- set :user, "root"
- set :domain, "172.20.5.107"
- set :application, "sgtran"
- set :use_sudo, false #railsplayground nao aceita sudo
- set :branch, "master" #branch que sera copiado
- set :deploy_to, "/astran/app" #pasta para onde serao enviados os arquivos
- set :deploy_via, :remote_cache
- set :git_shallow_clone, 1
- set :remote, user
- set :scm_verbose, true
- set :copy_cache, true
- set :keep_releases, 3 # mantem 3 versoes, posso fazer ate 3 rollbacks de versao
- # ==============================================================
- # ROLE's
- # ==============================================================
- role :web, domain
- role :app, domain
- role :db, domain, :primary => true
- before "deploy:setup", :db
- after "deploy:update_code", "gems:install"
- namespace :gems do
- desc "Install gems"
- task :install, :roles => :app do
- run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
- run "cd #{current_release} && rake gems:install"
- end
- end
- namespace :db do
- desc "Create database yaml in shared path"
- task :default do
- db_config = ERB.new <<-EOF
- base: &base
- adapter: mysql
- username: root
- password: 123456
- encoding: utf8
- development:
- database: #{application}_development
- <<: *base
- test:
- database: #{application}_test
- <<: *base
- production:
- database: #{application}_production
- <<: *base
- EOF
- run "mkdir -p #{shared_path}/config"
- put db_config.result, "#{shared_path}/config/database.yml"
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement