poise / application_ruby

Development repository for Opscode Cookbook application_ruby
Apache License 2.0
124 stars 153 forks source link

Add config_path param for unicorn resource #83

Open hron opened 8 years ago

dorongutman commented 8 years ago

Can this be merged ?

dorongutman commented 8 years ago

@coderanger can this be merged please ? You can see here the config file being passed as an argument to the cli unicorn command: https://unicorn.bogomips.org/unicorn_1.html

I cannot use unicorn (and therefor this cookbook) without passing it the config file.

loren commented 8 years ago

+1 I'm running into the same issue.

coderanger commented 8 years ago

As a reminder: you can always make subclasses. No one should be blocked on this, just subclass my unicorn resource and make whatever changes you need. You can also use the poise_service_options helper to more explicitly override the command line for the generated service. +1s don't magically give me more time, and are not needed.

dorongutman commented 8 years ago

@coderanger as I asked before here and/or in the halite repo - since you're not using the normal/regular chef way of writing cookbooks, it's not that easy to make changes. I've asked before - can you explain how will the subclassing work ? Don't I need Berkshelf to use the halite extension ? If so - as I wrote in the halite repo - after following all the instructions and adding the `extension 'halite' to the berkshelf file, I'm getting an exception about the extension.

loren commented 8 years ago

I apologize @coderanger if I came across as impatient. I appreciate the work you have done on these cookbooks. I wasn't able to figure out how the subclassing would work, but your poise_service_options clue helped, so thank you.

@dorongutman, this is what I ended up doing to get it to work:

  unicorn
  poise_service_options '/srv/myapp' do
    command '/opt/ruby_build/builds/2.3/bin/ruby /opt/ruby_build/builds/2.3/bin/bundle exec /opt/ruby_build/builds/2.3/bin/ruby /srv/myapp/vendor/bundle/ruby/2.3.0/bin/unicorn -c config/unicorn.rb --port 8000 /srv/myapp/config.ru'
  end
coderanger commented 8 years ago

Only semi-related but I wrote up a full example of using subclassing to fix this kind of issue without waiting for me https://gist.github.com/coderanger/962627150d3f3bd17bd2c8014260cee9