Grails: Cloud Foundry cheat sheet

This blog is a cheat sheet for using Cloud Foundry grails plugin. For details about the commands and how to install plugin please look at the guide.

Deploying Application

Initial state

grails cf-apps - list of active deployed applications

grails cf-info - Details about resources in use (Memory, Services & Apps)

Services

grails cf-services - display list of available and provisioned services

grails cf-create-service mysql - Creates an instance of a service

grails cf-delete-service mysql-2f5fb76 - Delete an instance of a service

Applications

grails prod cf-push - Push and optionally start an application

grails prod cf-push --services=mysql-2f5fb76 - Push and bind a service

Updating applications

Initial state

grails cf-bind-service mongodb-eaa5601 - Binds a service to an application.

grails cf-unbind-service mongodb-eaa5601 - Unbinds a service from an application.

URLs

grails cf-map myotherappname.cloudfoundry.com - Registers an additional URL with the specified application.

grails cf-unmap myotherappname.cloudfoundry.com - Unregisters a URL from the specified application.

Instances

grails cf-update-instances 3 - Scale up or down the number of instances.

grails cf-show-instances - Displays information about the instances of the specified application.

grails cf-stats - Report resource usage for an application.

Memory

grails cf-update-memory 1G - Increases or decreases the allocated memory for your application.

Start, stop, restart

grails cf-stop - Shuts down the server(s) running the application.

grails cf-start - Starts the server(s) for the application. Displays all logs if there's a problem starting.

grails cf-restart - This script is a utility script that calls stop and then start for the specified application.

Updating

grails prod cf-update - Rebuilds a war file for your application and redeploys it.

grails cf-delete-app - Deletes the specified registered application.

grails cf-delete-all-apps - Deletes all registered applications.

Monitoring

Crashes

grails cf-crashes - Displays a brief description of recent application crashes.

grails cf-crashlogs - Displays log files after a crash to help diagnose the cause.

Logs

grails cf-logs - Displays log files for an instance to the console, or to a file if specified.

Viewing files

grails cf-list-files / - Lists files in the specified directory on the server.

grails cf-list-files tomcat

grails cf-list-files tomcat/webapps

grails cf-get-file tomcat/webapps/ROOT/css/main.css - Display or download a single file.