Skip to content

Instantly share code, notes, and snippets.

@beccasaurus
Last active March 24, 2017 01:45
Show Gist options
  • Save beccasaurus/3ae9562de6aed8680ad1366acaca0690 to your computer and use it in GitHub Desktop.
Save beccasaurus/3ae9562de6aed8680ad1366acaca0690 to your computer and use it in GitHub Desktop.
Override RAILS_ENV and other environment variables on App Engine Flex
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
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