Task reference¶
- There exist a number of tasks inside the deploytools package, but most of the real main tasks are generated (from templates) via the following management tasks:
- create_deploy_tools. Creates the core fabfile for the project. This file can be customized for specific deployments
- add_deploy_target. Adds host/db/etc information. The name specified with this command can be used later in conjunction with tasks such as add_site or update_site.
- Tasks accessable after calling create_deploy_tools are:
- add_site: initial site setup.
- collectstatic: to run the collectstatic management of django >=1.4
- full_install: install the nearly completely all elements of the django/nginx/mysql software stack (except nginx & mysql at this moment)
- update_site: store the current migration state, do a commit to the local repository, rsync, syncdb && migrate, run tests and restart gunicorna
- remove_site: removes a site/db from a server.
The add_deploy_target command can add a new task, which represents a host/target for deployment (such as staging, production, etc). Although it is not specificly a task it is used to set the right variables for the real tasks by chaining the tasks in one command. Or more clearly see the example calls below:
- ::
- fab staging add_site # or fab live update_site
So first specify the target, then the task (or tasks) that you want to have performed.
Internal tasks¶
- Should you want to customize the fabfile that is generated by the create_deploy_tools, you might want to look at some more low level tasks, that by default are not exposed through the generated fabfile:
deploytools.base.create_mysql_db()
Creates a new mysql database/user on the host.deploytools.base.commit_snapshot()
Does an add all files (some files are excluded, see the .hgignore file).deploytools.supervisor.create_celery_workers()
Creates workers and a beat script for supervisor.deploytools.supervisor.create_gunicorn_script()
Creates the gunicorn script for supervisor.