cloudfoundry / multiapps-cli-plugin

A CLI plugin for Multi-Target Application (MTA) operations in Cloud Foundry
Apache License 2.0
81 stars 41 forks source link

MultiApps logo

MultiApps CF CLI Plugin Multiapps CLI Plugin build

This is a Cloud Foundry CLI plugin (formerly known as CF MTA Plugin) for performing operations on Multitarget Applications (MTAs) in Cloud Foundry, such as deploying, removing, viewing, etc. It is a client for the CF MultiApps Controller (known also as CF MTA Deploy Service), which is an MTA deployer implementation for Cloud Foundry. The business logic and actual processing of MTAs happens into CF MultiApps Controller backend.

Requirements

Download and Installation

:rotating_light: Check whether you have a previous version installed, using the command: cf plugins. If the MtaPlugin is already installed, you need to uninstall it first and then to install the new version. You can uninstall the plugin using command cf uninstall-plugin MtaPlugin.

CF Community Plugin Repository

The MultiApps CF CLI Plugin is now also available on the CF Community Repository. To install the latest available version of the MultiApps CLI Plugin execute the following:

cf install-plugin multiapps

If you do not have the community repository in your CF CLI you can add it first by executing:

cf add-plugin-repo CF-Community https://plugins.cloudfoundry.org

Manual Installation

Alternatively you can install any version of the plugin by manually downloading it from the releases page and installing the binaries for your specific operating system.

Download

The latest version of the plugin can also be downloaded from the project's releases. Download the plugin for your platform (Darwin, Linux, Windows).

Mac OS X 64 bit Mac OS X Arm64 Windows 32 bit Windows 64 bit Linux 32 bit Linux 64 bit Linux Arm64
multiapps-plugin.osx multiapps-plugin.osxarm64 multiapps-plugin.win32.exe multiapps-plugin.win64.exe multiapps-plugin.linux32 multiapps-plugin.linux64 multiapps-plugin.linuxarm64

Installation

Install the plugin, using the following command:

cf install-plugin <path-to-the-plugin> -f

:rotating_light: Note: if you are running on an Unix-based system, you need to make the plugin executable before installing it. In order to achieve this, execute the following commad chmod +x <path-to-the-plugin>

Usage

The MultiApps CF plugin supports the following commands:

Command Name Command Description
deploy Deploy a new multi-target app or sync changes to an existing one
undeploy Undeploy (remove) a multi-target app
mtas List all multi-target apps
mta Display health and status for a multi-target app
mta-ops List active multi-target app operations
download-mta-op-logs / dmol Download logs of multi-target app operation
bg-deploy Deploy a multi-target app using blue-green deployment
purge-mta-config Purge stale configuration entries

For more information, see the command help output available via cf [command] --help or cf help [command].

Here is an example deployment of the open-sourced spring-music:

git clone https://github.com/nvvalchev/spring-music.git
cf deploy mta-assembly/spring-music.mtar -e config.mtaext

Configuration

The configuration of the MultiApps CF plugin is done via env variables. The following are supported:

How to contribute

Development

WARNING : with Issue 117 the master branch of this repository as well as other artifacts will be renamed. Adaptation to any CI/CD infrastructure & scritps will be required.

Cloning the repository

To clone the project in your Go workspace $GOPATH/src/github.com/cloudfoundry-incubator/multiapps-cli-plugin execute the following commands:

mkdir -p $GOPATH/src/github.com/cloudfoundry-incubator
cd $GOPATH/src/github.com/cloudfoundry-incubator
git clone git@github.com:cloudfoundry-incubator/multiapps-cli-plugin.git

Building new release version

You can automatically build new release for all supported platforms by calling the build.sh script with the version of the build. The version will be automatically included in the plugin, so it will be reported by cf plugins.

:rotating_light: Note that the version parameter should follow the semver format (e.g. 1.2.3).

./build.sh 1.2.3

This will produce mta_plugin_linux_amd64, mta_plugin_darwin_amd64 and mta_plugin_windows_amd64 in the repo's root directory.

Further reading

Presentations, documents, and tutorials:

License

This project is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file.