项目作者: faisaltheparttimecoder

项目描述 :
A plugin on top of cf cli "delete" command that adds extra feature for easy cleanup
高级语言: Go
项目地址: git://github.com/faisaltheparttimecoder/cf-cli-delete-wrapper-plugin.git


cf-cli-delete-wrapper-plugin

A cf cli plugin that is a wrapper on top of “cf delete” command.
This plugin wrapper provides two commands that helps to easy cleanup of apps.

  1. You can now delete multiple apps via single command
  2. Command that auto detects the app name from manifest and deletes them

Installation

You can use either of the below method to install the plugin.

Option 1:

  1. Download the latest plugin from the release section of this repository
  2. Install the plugin with cf install-plugin <path_to_binary>. Use -f flag to uninstall existing plugin if any and install the new one.

Option 2:

If you are using MacOS, you could run

  1. cf install-plugin -f https://github.com/faisaltheparttimecoder/cf-cli-delete-wrapper-plugin/releases/download/0.1.1/cf-delete-wrapper_v0.1.1.osx

Usage

  1. Command: delete-multi-apps, Alias: dma

    1. $ cf delete-multi-apps --help
    2. NAME:
    3. delete-multi-apps - Delete multiple apps via a single command
    4. ALIAS:
    5. dma
    6. USAGE:
    7. cf delete-multi-apps -a <APP1>,<APP2>,....,<APPn>
    8. OPTIONS:
    9. -force -f, no need to prompt for confirmation
    10. -app -a, list of apps to be deleted
  2. Command: delete-app-using-manifest, Alias: daum

    1. $ cf delete-app-using-manifest --help
    2. NAME:
    3. delete-app-using-manifest - Detect the apps name from manifest and delete it
    4. ALIAS:
    5. daum
    6. USAGE:
    7. cf delete-app-using-manifest
    8. OPTIONS:
    9. -force -f, no need to prompt for confirmation

Example

  • To delete multiple at once

    1. $ cf dma -a test1,test2,test3
    2. Are you sure you want to delete these apps (test1,test2,test3), do you wish to continue (Yy/Nn)?: y
    3. Successfully deleted the app "test1"
    4. Successfully deleted the app "test2"
    5. Successfully deleted the app "test3"
  • To delete an app that is on the manifest

    1. $ cat manifest.yml
    2. ---
    3. applications:
    4. - name: customer-test
    5. $ cf daum
    6. Are you sure you want to delete these apps (customer-test), do you wish to continue (Yy/Nn)?: y
    7. Successfully deleted the app "customer-test"

Build

  1. go get github.com/faisaltheparttimecoder/cf-cli-delete-wrapper-plugin/
  2. -- Modify the code
  3. run "/bin/sh run.sh" to build package