Skip to content

Instantly share code, notes, and snippets.

@zembutsu
Created June 24, 2014 13:18
Show Gist options
  • Select an option

  • Save zembutsu/90e15275b4596aac0e5c to your computer and use it in GitHub Desktop.

Select an option

Save zembutsu/90e15275b4596aac0e5c to your computer and use it in GitHub Desktop.
envconsulのビルド方法と動作確認 ref: http://qiita.com/zembutsu/items/6ef3d5f35d72a95cf2cd
$ mkdir -p ~/go/src/github.com/armon
$ cd ~/go/src/github.com/armon
$ git clone [email protected]:armon/consul-kv.git
$ ./envconsul
Usage: envconsul [options] prefix child...
Sets environmental variables for the child process by reading
K/V from Consul's K/V store with the given prefix.
Options:
-addr="127.0.0.1:8500": consul HTTP API address with port
-dc="": consul datacenter, uses local if blank
-errexit=false: exit if there is an error watching config keys
-reload=false: if set, restarts the process when config changes
-sanitize=true: turn invalid characters in the key into underscores
-upcase=true: make all environmental variable keys uppercase
$ envconsul -addr="ホスト名:ポート番号" prefix名 実行コマンド
$ envconsul -addr="sakura1.pocketstudio.net:8500" test env | grep ENABLED
ENABLED=true
$ envconsul -addr="sakura1.pocketstudio.net:8500" -reload test /bin/sh -c "
uptime; /bin/sleep 1d"
22:15:51 up 90 days, 2:15, 1 user, load average: 0.36, 0.52, 0.49
22:15:58 up 90 days, 2:15, 1 user, load average: 0.31, 0.50, 0.49
22:16:01 up 90 days, 2:15, 1 user, load average: 0.31, 0.50, 0.49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment