Last active
March 24, 2017 01:45
-
-
Save beccasaurus/3ae9562de6aed8680ad1366acaca0690 to your computer and use it in GitHub Desktop.
Override RAILS_ENV and other environment variables on App Engine Flex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "webrick" | |
require "yaml" | |
server = WEBrick::HTTPServer.new Port: ENV["PORT"] || 8080 | |
server.mount_proc "/" do |request, response| | |
response.content_type = "text/plain" | |
response.body = "ENV Variables: #{ENV.to_hash.to_yaml}" | |
end | |
trap "INT" do | |
server.stop | |
end | |
server.start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
env: flex | |
runtime: ruby | |
entrypoint: ruby app.rb | |
env_variables: | |
APP_YAML_VAR: this was set in the app.yaml | |
RAILS_ENV: overridden |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment