Can you rewrite these rules please? Thanks

task :start, :roles => :app do
run "cd #{deploy_to}/current/; RAILS_ENV=production bundle exec 
unicorn_rails -c #{unicorn_path} -D"
end

task :stop, :roles => :app do
run "if [ -e '#{deploy_to}/shared/pids/unicorn.pid' ]; then kill -QUIT cat 
#{deploy_to}/shared/pids/unicorn.pid; fi"
end

task :restart, :roles => :app do
stop
start

end
end

task :notify_rollbar, :roles => :app do
set :revision, git log -n 1 --pretty=format:"%H"
set :local_user, whoami
set :rollbar_token, 'token_here'
rails_env = fetch(:rails_env, 'production')
run "curl https://api.rollbar.com/api/1/deploy/ -F 
access_token=#{rollbar_token} -F environment=#{rails_env} -F 
revision=#{revision} -F local_username=#{local_user} >/dev/null 2>&1", :once 
=> true
end

after "deploy:update", "deploy:link_uploads", "deploy:link_receipts"
after :deploy, 'notify_rollbar'







On Friday, May 15, 2015 at 4:10:19 PM UTC-4, Lee Hambley wrote:
>
> Sorry no time.
>
> Lee Hambley
> http://lee.hambley.name/
> +49 (0) 170 298 5667
>
> On 15 May 2015 at 21:43, Kevin Nguyen <[email protected] <javascript:>> 
> wrote:
>
>> Thanks, Lee. Can you take a look at my old deploy.rb? I really dont know 
>> how to rewrite all of them.
>>
>> http://pastebin.com/ashcqS4Y
>>
>> On Friday, May 15, 2015 at 3:38:14 PM UTC-4, Lee Hambley wrote:
>>>
>>> I'm not sure where you expect that unicorn task to come from, probably 
>>> you are looking for a plugin like 
>>> https://github.com/tablexi/capistrano3-unicorn
>>>
>>> Lee Hambley
>>> http://lee.hambley.name/
>>> +49 (0) 170 298 5667
>>>
>>> On 15 May 2015 at 21:29, Kevin Nguyen <[email protected]> wrote:
>>>
>>>> Versions:
>>>>
>>>>    - Ruby 2.2.2
>>>>    - Capistrano 3.4.0
>>>>    - Rake / Rails / etc rails 4.2.1
>>>>
>>>> Platform:
>>>>
>>>>    - Working on....Ubuntu 15.04
>>>>    - Deploying to... Server
>>>>
>>>> Logs:
>>>>
>>>> deploy@ubuntu:~/apps/miraclegrow2/current$ cap production unicorn:start 
>>>> --trace
>>>> ** Invoke production (first_time)
>>>> ** Execute production
>>>> ** Invoke load:defaults (first_time)
>>>> ** Execute load:defaults
>>>> ** Invoke rbenv:validate (first_time)
>>>> ** Execute rbenv:validate
>>>> DEBUG [ff0302a9] Running /usr/bin/env [ -d ~/.rbenv/versions/2.2.2 ] on 
>>>> 192.168.110.142
>>>> DEBUG [ff0302a9] Command: [ -d ~/.rbenv/versions/2.2.2 ]
>>>> DEBUG [ff0302a9] Finished in 1.866 seconds with exit status 0 
>>>> (successful).
>>>> ** Invoke rbenv:map_bins (first_time)
>>>> ** Execute rbenv:map_bins
>>>> ** Invoke bundler:map_bins (first_time)
>>>> ** Execute bundler:map_bins
>>>> ** Invoke deploy:set_rails_env (first_time)
>>>> ** Execute deploy:set_rails_env
>>>> ** Invoke deploy:set_rails_env
>>>> cap aborted!
>>>> Don't know how to build task 'unicorn:start'
>>>> /home/deploy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task_manager.rb:62:in
>>>>  
>>>> `[]'
>>>> /home/deploy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:149:in
>>>>  
>>>> `invoke_task'
>>>> /home/deploy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:106:in
>>>>  
>>>> `block (2 levels) in top_level'
>>>> /home/deploy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:106:in
>>>>  
>>>> `each'
>>>> /home/deploy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:106:in
>>>>  
>>>> `block in top_level'
>>>> /home/deploy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:115:in
>>>>  
>>>> `run_with_threads'
>>>> /home/deploy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:100:in
>>>>  
>>>> `top_level'
>>>> /home/deploy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:78:in
>>>>  
>>>> `block in run'
>>>> /home/deploy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:176:in
>>>>  
>>>> `standard_exception_handling'
>>>> /home/deploy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:75:in
>>>>  
>>>> `run'
>>>> /home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/capistrano-3.4.0/lib/capistrano/application.rb:15:in
>>>>  
>>>> `run'
>>>> /home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/capistrano-3.4.0/bin/cap:3:in
>>>>  
>>>> `<top (required)>'
>>>> /home/deploy/.rbenv/versions/2.2.2/bin/cap:23:in `load'
>>>> /home/deploy/.rbenv/versions/2.2.2/bin/cap:23:in `<main>'
>>>>
>>>> Files:
>>>>
>>>>    - Capfile 
>>>>
>>>> # Load DSL and set up stages
>>>> require 'capistrano/setup'
>>>>
>>>> # Include default deployment tasks
>>>> require 'capistrano/deploy'
>>>>
>>>> # Include tasks from other gems included in your Gemfile
>>>> #
>>>> # For documentation on these, see for example:
>>>> #
>>>> #   https://github.com/capistrano/rvm
>>>> #   https://github.com/capistrano/rbenv
>>>> #   https://github.com/capistrano/chruby
>>>> #   https://github.com/capistrano/bundler
>>>> #   https://github.com/capistrano/rails
>>>> #   https://github.com/capistrano/passenger
>>>> #
>>>> # require 'capistrano/rvm'
>>>> require 'capistrano/rbenv'
>>>> # require 'capistrano/chruby'
>>>> require 'capistrano/bundler'
>>>> require 'capistrano/rails'
>>>> require 'capistrano/rails/assets'
>>>> require 'capistrano/rails/migrations'
>>>> # require 'capistrano/passenger'
>>>> set :rbenv_ruby, '2.2.2'
>>>> # Load custom tasks from `lib/capistrano/tasks` if you have any defined
>>>> Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
>>>> Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
>>>>
>>>>
>>>>    - deploy.rb
>>>>
>>>>        http://pastebin.com/LqjwNndF
>>>>
>>>>    - Stage files (production.rb, staging.rb)
>>>>
>>>>        http://pastebin.com/1dD8euQ8
>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Capistrano" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to [email protected].
>>>> To view this discussion on the web, visit 
>>>> https://groups.google.com/d/msgid/capistrano/2cf1c9d1-18ec-4f05-b32e-496afe6d5734%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/capistrano/2cf1c9d1-18ec-4f05-b32e-496afe6d5734%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Capistrano" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web, visit 
>> https://groups.google.com/d/msgid/capistrano/8509c5c5-b2e8-4033-aadb-b5637e9d077a%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/capistrano/8509c5c5-b2e8-4033-aadb-b5637e9d077a%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/capistrano/57ca261e-b07a-4f21-a192-df85d6543c95%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to