laserlemon / figaro

Simple Rails app configuration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How do you export application.yml to env vars

TheNotary opened this issue · comments

I'm noticing a command, figaro heroku:set which looks awesome, but I can't use it with dokku apparently. If there's nothing set up to do it with dokku, I'd appreciate a command that's something like figaro vars:dump that outputs something like this:

export AWS_PASS='blahblah'

So I can easily redirect that into my clipboard and then paste it into /home/dokku/app_name/ENV to get a new server setup and inline with my local dev/staging env.

The https://github.com/laserlemon/figaro/blob/master/lib/figaro/cli/heroku_set.rb#L12-L14 is responsible for the heroku:set command. If you hack the first private method named run to be the below, you get a pretty nice command:

      def command
        # "heroku config:set #{vars} #{for_app} #{for_remote}"
        "echo dokku config:set APP_NAME #{vars} #{for_app} #{for_remote}"
      end

There's still a problem, that you need to manually replace APP_NAME in the output string.

Does anyone else want a figaro config:print or something?