Command Line Tools
These tools will not 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:
-
Install the Java Development Kit on your computer. Set the JAVA_HOME environment variable to where you installed Java on your computer.
-
Download the CloudHub distribution cloudhub-cli-1.0.1.zip file.
-
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. -
If you are using a Mac or Linux computer, ensure that the
cloudhub-
commands are executable by using a command such aschmod 700 cloudhub-*
. -
Add the bin directory to your PATH.
$ export PATH=/path/to/cloudhub-cli-18-SNAPSHOT/bin:$PATH
-
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.
Access 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-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:
$ 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-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]