etcd + env = awesome!
env command integrated with etcd server
$ curl http://127.0.0.1:4001/v1/keys/app/db -d value="newdb"
$ curl http://127.0.0.1:4001/v1/keys/app/cache -d value="new cache"
$ curl http://127.0.0.1:4001/v1/keys/app2/db -d value="otherdb"
$ curl http://localhost:4001/v1/keys/app
[{"action":"GET","key":"/app/db","value":"newdb","index":4},{"action":"GET","key":"/app/cache","value":"new cache","index":4}]
$ etcdenv -key=/app/
DB=newdb
CACHE=new cache
$ etcdenv -key=/app/ ruby web.rb
$ etcdenv -key=/ -r
DB=newdb,otherdb
CACHE=new cache
$ cat myapp.sh
#!/path/to/etcdenv -key=/myapp ./myapp.sh
If you are using OSs which the shell doesn't parse arguments separated with spaces, try to use -s option.
$ cat myapp.sh
#!/path/to/etcdenv -s -key=/myapp ./myapp.sh
$ cat Procfile
web: etcdenv -key=/myapp/ ruby web.rb
MIT: http://mattn.mit-license.org/2013