Nav

Command Line Tools

These tools will no longer be supported in future versions.

Check Command Line Interface Shell for a more updated set of tools to operate from your console.

CloudHub provides a set of tools to help you deploy and manage your applications seamlessly from the command line.

Here’s a summary of the commands:

Command Description

List all your applications on CloudHub and their status

Create a new application on CloudHub

Update an application, its workers, and its environment variables

Delete an application

List the last lines (tails) of the logs from your application

Installation

To install the tools:

  1. Install the Java Development Kit on your computer. Set the JAVA_HOME environment variable to where you installed Java on your computer.

  2. Download the CloudHub distribution cloudhub-cli-1.0.1.zip file.

  3. Unzip/extract the distribution in a location on your local machine.

    $ unzip cloudhub-cli-1.0.1.zip

    The zip file creates the cloudhub-cli-18-SNAPSHOT directory.

  4. If you are using a Mac or Linux computer, ensure that the cloudhub- commands are executable by using a command such as chmod 700 cloudhub-*.

  5. Add the bin directory to your PATH.

    $ export PATH=/path/to/cloudhub-cli-18-SNAPSHOT/bin:$PATH
  6. Optionally set the following environment variables to make invoking the commands easier:

    Environment Variable Description

    CLOUDHUB_USERNAME

    Your Anypoint Platform username

    CLOUDHUB_PASSWORD

    Your Anypoint Platform password

    CLOUDHUB_DOMAIN

    Your application domain

This makes the domain, username, and password arguments optional in the commands below.

Note: Use the --help parameter with a command to see what options are available.

Accessing Different Environments

Your username controls which environment you’re accessing and is of the form user@environment. For example, if your username is joe and you have an environment called "Development", your username is joe@Development. If you don’t specify an environment, it defaults to production.

cloudhub-list

Example:

$ cloudhub-list
hello: STARTED

cloudhub-create

The first time that you create your application, a cloudhub.properties file is created with all of the additional parameters (location of your file, number of workers, and all system properties). Each time you update your application, these properties are automatically loaded from this cloudhub.properties file.

Example:


         
      
1
2
3
4
5
6
$ cloudhub-create -d test -f ../web/target/test-classes/hello.zip -w 1 -D foo:bar hello:test
Creating application...
Creating properties file...
Application created!
Uploading application...
Application uploaded!

cloudhub-update

Example:

cloudhub-update

cloudhub-delete

Example:

$ cloudhub-delete -d app

cloudhub-logs

Lists the last lines (tails) of the log results from your application. Output continues to tail the logs until you press CTRL-C.

Example:

$ cloudhub-logs
...
INFO    11-04-05 07:21:41   [ApplicationServiceImpl] Successfully deployed [test]