cfm is the small utility which wrap cloud foundry cli to be able to run same command on multiple cloud foundry.
You can install this via the command-line with either curl
or wget
.
$ bash -c "$(curl -fsSL https://raw.github.com/orange-cloudfoundry/cfm/master/bin/install.sh)"
$ bash -c "$(wget https://raw.github.com/orange-cloudfoundry/cfm/master/bin/install.sh -O -)"
You can install it by downloading the .exe
corresponding to your cpu from releases page: https://github.com/orange-cloudfoundry/cfm/releases .
Alternatively, if you have terminal interpreting shell you can also use command line script above, it will download file in your current working dir.
Simply run in terminal:
$ go get github.com/orange-cloudfoundry/cfm
You must set target with add-target
for each cloud foundry:
cfm [OPTIONS] add-target [add-target-OPTIONS]
Add cloud foundry target
Application Options:
-h, --help
Help Options:
-h, --help Show this help message
[add-target command options]
-t, --target= Cloud foundry target
-a, --alias= set an alias to the target
Example: cfm add-target -t https://api.my.cloudfoundry.com -a mycf
you can now perform a multi-login to log on each platform:
cfm [OPTIONS] multi-login [multi-login-OPTIONS]
perform login on all targets
Application Options:
-h, --help
Help Options:
-h, --help Show this help message
[multi-login command options]
-a= api
-u= username
-p= password
-o= org
-s= s
--skip-ssl-validation skip-ssl-validation
example: cfm multi-login -u $CF_USERNAME -p $CF_PASSWORD
simply call cfm with cf valid arguments and the command will be called on each targets, example for see each orgs on targets:
$ cfm orgs
You may want to do commands for only one targets and not re-login through normal cli, to do so you can use this command:
cfm [OPTIONS] set-cf-env [set-cf-env-OPTIONS]
set your cf normal cli to targeted cloud foundry
Application Options:
-h, --help
Help Options:
-h, --help Show this help message
[set-cf-env command options]
-t, --target= Cloud foundry target
-a, --alias= set an alias to the target
Example: cfm set-cf-env -a mycf
You can now perform command with normal cf
cli.
You can group your target to perform command only on this group.
First you will need to add target with a group name:
cfm add-target -t https://api.my.cloudfoundry.com -a mycf -g prod
You have no to target this group to do so use set-group
command:
cfm set-group -g prod
you can clear the group target by call set-group without name: cfm set-group