Code Monkey home page Code Monkey logo

cf-targets-plugin's Introduction

CF Targets Plugin

Build Status

This plugin facilitates the use of multiple api targets with the Cloud Foundry CLI.

It originated from the need for a Go play project, and the realization that I was frequently switching back and forth between development and various test environments, using tricks like

CF_HOME=~/cf-development cf push my-app
CF_HOME=~/cf-production cf push my-app

This plugin makes switching a lot less painful by allowing you to save your currently configured target using a name, then switching back to it by name at any point.

##Usage

Configure and save any number of named targets

$ cf api <development-target-url>
$ cf login
...
$ cf save-target development

Followed by

$ cf api <production-target-url>
$ cf login
...
$ cf save-target production

After saving targets, easily switch back and forth between them using:

$ cf set-target development
$ cf target
API Endpoint:   <development-target-url>
...
$ cf set-target production
$ cf target
API Endpoint:   <production-target-url>
...

View saved targets using

$ cf targets
development
production (current)

##Installation #####Install from CLI

$ cf add-plugin-repo CF-Community http://plugins.cloudfoundry.org/
$ cf install-plugin targets -r CF-Community

#####Install from Source (need to have Go installed)

$ go get github.com/cloudfoundry/cli
$ go get github.com/guidowb/cf-targets-plugin
$ cd $GOPATH/src/github.com/guidowb/cf-targets-plugin
$ go build
$ cf install-plugin cf-targets-plugin

##Full Command List

command usage description
targets cf targets list all saved targets
save-target cf save-target [-f] [<name>] save the current target for later use
set-target cf set-target [-f] <name> restore a previously saved target
delete-target cf delete-target <name> delete a previously saved target

cf-targets-plugin's People

Contributors

guidowb avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.