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

add heroku support #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

add heroku support #3

wants to merge 2 commits into from

Conversation

yoshiori
Copy link

Add support for HEROKU's dyno-metadata.
https://devcenter.heroku.com/articles/dyno-metadata

Copy link
Owner

@sorah sorah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding support for a specific vendor is too adhoc, I may accept the patch if it takes an environment variable name instead of something hard-coded.

However, to return a specific environment variable can be achieved by the following code, so I don't think you need a revision_plate:

# config.ru
map '/site/sha' do
  run lambda {|env| [200, {"Content-Type" => "text/plain"}, ["#{ENV["HEROKU_SLUG_COMMIT"}}\n"]] }
end

# config/routes.rb
Rails.application.routes.draw do |r|
  r.get '/site/sha' => lambda {|env| [200, {"Content-Type" => "text/plain"}, ["#{ENV["HEROKU_SLUG_COMMIT"}}\n"]] }
end

But I understand if an app runs on multiple platforms, support loading from environment variables may help.

So in conclusion, I wish the interfaces like:

run RevisionPlate::App, nil, revision_proc: -> { ENV["HEROKU_SLUG_COMMIT"] }

and revision_proc should take precedence than a file.

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 this pull request may close these issues.

2 participants