Skip to content

Instantly share code, notes, and snippets.

@sfriesel
Created November 18, 2014 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sfriesel/2273f30dda1ac8adaa02 to your computer and use it in GitHub Desktop.
Save sfriesel/2273f30dda1ac8adaa02 to your computer and use it in GitHub Desktop.
cca interface proposal
#!/usr/bin/env python
'''
Examples:
cca connect sftest
cca push
cca push --force master:staging
cca config set DJANGO_DEBUG=true
cca addon add newrelic free
cca worker start billing_monthly
cca -A core -D default deployment show
Usage:
cca [-AD] list
cca [-AD] create <app> (java|nodejs|php|python|ruby)
cca [-AD] connect <app>
cca [-AD] show
cca [-AD] delete
cca [-AD] deployment create <deployment>
cca [-AD] deployment show
cca [-AD] deployment delete
cca [-AD] push [--force] [--clean] [<refspec>]
cca [-AD] deploy [--containers <num> --memory <size> --stack <stack> --restart-workers] [<version>]
cca [-AD] rollback
cca [-AD] run [<command>]
cca [-AD] user add <email> [<deployment>]
cca [-AD] user remove <email> [<deployment>]
cca [-AD] config show
cca [-AD] config set <assignment>...
cca [-AD] config unset <var>...
cca [-AD] addon add <addon> <option>
cca [-AD] addon [show [--all-available]]
cca [-AD] addon remove <addon> <option>
cca [-AD] addon (upgrade|downgrade) <addon> <old-option> <new-option>
cca [-AD] addon creds
cca [-AD] alias [show]
cca [-AD] alias add <alias>
cca [-AD] alias remove <alias>
cca [-AD] cron [show]
cca [-AD] cron add <alias>
cca [-AD] cron remove <alias>
cca [-AD] worker [show [<wrk-id>]]
cca [-AD] worker start [--memory <size>] <command> [<params>]
cca [-AD] worker stop <wrk-id>
cca [-AD] worker restart (<wrk-id>|--all)
cca [-AD] log (access|error|worker|deploy)
cca [-AD] open
Commands:
list
List all apps you have access to.
create
Create an application called <app-name>. The name must be unique on
the platform. If run interactively, will ask if the current directory
should be connected to the app.
connect
Associate the current working directory with the app <app-name>.
Commands run under this directory will use this app by default.
show
Show information about the current app.
delete
Delete the current app.
deployment create
Creates a deployment called <deployment> in the current app.
Push and deploy create deployments automatically, so this is
normally not needed.
deployment show
Show information about the current deployment.
deployment delete
Delete the current deployment
push
Push the specified branch to the specified deployment and build an image
out of it. If branch is not
given, uses current branch. If deployment is not given use matching
deployment. If --force is supplied, overwrite the history in the
remote branch. If --clean is supplied, delete the buildpack cache before
the build is started.
deploy
Deploy the current deployment, changing the supplied settings if any. If
no version is specified, the last pushed one is used. --restart-workers
has the same effect like running cca worker restart --all after the deploy.
Options:
-h Show this screen.
-A <app>, --app <app> Use this app as current app.
-D <deployment>, --dep <deployment> Use this deployment as current deployment.
--containers <num> Change number of containers to deploy. Contact support if you need a higher limit.
--memory <size> Change size of each container in multiple of 128M.
--stack <stack> Change runtime stack.
'''
from docopt import docopt
arguments = docopt(__doc__, version='cca 2.0')
print(arguments)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment