Skip to content

Samze/copyenv

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cloud Foundry CLI Copy Env Plugin

Cloud Foundry CLI plugin to export application VCAP_SERVICES onto the local machine.

Applications running on Cloud Foundry rely on the VCAP_SERVICES environment variable to provide service credentials.

When running applications locally for development and testing, it's useful to have the same VCAP_SERVICES values available in the local environment to simulate running on the host platform.

This plugin will export the remote application environment variables, available using cf env, into a format that makes it simple to expose those same values locally.

copy env plugin

Install

$ go get github.com/jthomas/copyenv
$ cf install-plugin $GOPATH/bin/copyenv

Usage

$ cf copyenv APP_NAME

export VCAP_SERVICES='...'

The plugin output needs to be evaluated in your shell to set up the local environment variables.

Using eval:

$ eval `cf copyenv APP_NAME` 

Using a temporary file:

$ cf copyenv APP_NAME > temp.json
$ source temp.json

You can obtain additional information with flags.

$ cf copyenv APP_NAME -all

export VCAP_SERVICES='...'
export VCAP_APPLICATION='...'

Uninstall

$ cf uninstall-plugin copyenv

About

CF CLI Plugin for copying application variables into local environment

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%