Last active
March 6, 2023 17:14
-
-
Save aarkerio/3eb5cfecd3488668e8738af20a28b293 to your computer and use it in GitHub Desktop.
set_heroku_vars
This file contains 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 'json' | |
raw_data = File.read('prod_vars.json') | |
# {"ASSET_HOST": "https://foo.cloudfront.net", } | |
vars_info = JSON.parse(raw_data); | |
puts "### vars_info ###>> #{vars_info.inspect}" | |
HEROKU_APP = 'bananas-app-staging' | |
vars_info.each do |key, var| | |
puts "### KEY ###>> #{key.inspect}" | |
puts "### VAR ###>> #{var.inspect}" | |
cmd = "heroku config:set #{key}=#{var} -a #{HEROKU_APP}" | |
puts "### CMD ###>> #{cmd.inspect}" | |
puts "### --------------------------------------------- ###" | |
system(cmd) | |
sleep 2 | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment