Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes, set :unicorn_exec not working... #60

Open
sizer opened this issue Jun 14, 2019 · 0 comments · May be fixed by #61
Open

Sometimes, set :unicorn_exec not working... #60

sizer opened this issue Jun 14, 2019 · 0 comments · May be fixed by #61

Comments

@sizer
Copy link

sizer commented Jun 14, 2019

deploy.rb

lock '3.11.0'
....
set :unicorn_exec, :unicorn_rails
...
namespace :unicorn do
  before :start, :logging

  task :logging do
    on roles :app do
      execute :echo, fetch(:unicorn_exec)
    end
  end
end

and execute log is below.

sizer@geb:~/capistrano3-unicorn-test
$ bundle exec cap staging unicorn:start
00:00 unicorn:logging
      01 echo unicorn_rails
      01 unicorn_rails
    ✔ 01 centos@staging 0.178s
00:00 unicorn:start
      01 RBENV_ROOT=~/.rbenv/ RBENV_VERSION=2.4.5 ~/.rbenv/bin/rbenv exec bundle exec unicorn -c ./config/unicorn.rb -E staging -D 
    ✔ 01 centos@staging 9.317s

echo returns 'unicorn_rails' correctly, but unicorn:start returns default value... 🤔

execute() has a subtle behaviour. When calling within './directory' { execute(:bundle, :install) } for example, the first argument to execute() is a Stringish with no whitespace. This allows the command to pass through the SSHKit::CommandMap which enables a number of powerful features.
https://capistranorb.com/documentation/getting-started/tasks/

I recommend that removing whitespace from tasks/unicorn.rake .

@sizer sizer linked a pull request Jun 14, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant