3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

cf env から vcap_services を取得して環境変数にセットする

Posted at

ローカルでアプリ開発する場合に、環境変数をセットするのは面倒なので、cf env から取ってきてセットするbashスクリプト

OS: mac
cf version: 6.12.4-b4b6af1-2015-09-18T17:54:54+00:00

export VCAP_SERVICES=`cf env <appname> | awk -v RS= -v ORS='\n\n' '/System-Provided:/' | awk 'BEGIN{lines=""}NR>1{lines=lines$0}END{print lines}'| python -c "import sys,json;print json.dumps(json.loads(sys.stdin.read())['VCAP_SERVICES'])"`
3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?