pusher / stronghold-ruby

Ruby client for stronghold.
MIT License
1 stars 1 forks source link

To env #5

Closed zimbatm closed 8 years ago

zimbatm commented 8 years ago

/cc @seeemilyplay

Tested with stronghold-cli --path /some/path --env --run env

zimbatm commented 8 years ago

The last commit depends on https://github.com/pusher/stronghold/pull/5

seeemilyplay commented 8 years ago

What's the motivation/context behind the change?

zimbatm commented 8 years ago

I want to convert an env-configured program to use stronghold as a configuration source. With the second change I can now prefix my program with stronghold-cli --path /some/path --env --run my-program and put that in an init script.

The last change is motivated by the fast that I want to detect if the configuration has changed and if the process needs restarting. It's a bit hacky but I can read from /proc/<pid>/environ, find out the ETag and compare it to my own invocation of stronghold-cli. Then put that as a buddha pre-check.

seeemilyplay commented 8 years ago

Ah okay, cunning :-) :+1: