Heroku addons configuration #31

Closed
wants to merge 3 commits into
from

Projects

None yet

5 participants

@picuous
picuous commented Feb 7, 2011

I just added the ability to configure heroku's addons.
The configuration is pretty minimal: it helps for the initial set up of an app.

@fj
fj commented Jun 21, 2011

This would be useful. Are there blockers to pulling it in?

@arnaud
arnaud commented Jun 21, 2011

I don't see any.

@bryan-ash bryan-ash commented on the diff Sep 3, 2011
lib/heroku_san/tasks.rb
end
end
end
+ desc 'Add addons to each application.'
+ task :addons do
+ each_heroku_app do |name, app, repo, config, addons|
+ (addons.split(',')).each do |addon|
@bryan-ash
bryan-ash Sep 3, 2011 Contributor

Does this work for you? addons is populated with a Hash if I follow the example.yml:

addons:
  custom_domains: "basic"

Even if I specify as an Array:

addons:
- custom_domains:basic

Arrays don't implement split.

@arnaud
arnaud Sep 3, 2011

As a matter of fact, it's actually set for using a one-liner string, mind you!

@bryan-ash
bryan-ash Sep 3, 2011 Contributor

I think this should be:

addons.each do |addon|

with heroku.yml:

addons:
- custom_domains:basic
- cron:daily
@arnaud
arnaud Sep 3, 2011

Some heroku addons don't have the second part (the :foopart). How could you handle them with either an Array or a Hash? I felt that, because of this requirement, String was the only way...

@bryan-ash
bryan-ash Sep 3, 2011 Contributor

As I described above, the addons key has a value that is an Array of strings

addons:
- custom_error_pages
- cron:daily

Would yield:

addons = @app_settings[name]['addons'] || []
=> addons = [ "custom_error_pages", "cron:daily" ]
@arnaud
arnaud Sep 4, 2011

Yeah, you are right. Will be nicer.

@bryan-ash
bryan-ash Sep 4, 2011 Contributor

I pushed it up: bryan-ash@8c11593

@bryan-ash
Contributor

It would be nice if this gracefully handled existing addons. If I have some addons, then edit my heroku.yml to include a new one, I'd like 'rake production addons' to install or update the new addons.

@kmayer
Contributor
kmayer commented Mar 4, 2012

See also #69

@kmayer kmayer referenced this pull request Mar 4, 2012
Closed

Addons #69

@kmayer
Contributor
kmayer commented Apr 23, 2012

Closed by #81

@kmayer kmayer closed this Apr 23, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment