Problem

Create Python Fabric deployment script

Solution

The fabfile has been created with multiple options, for example:

dev Dev-server settings
prod Production settings
admin.add_ssh_public_key Add ssh public key to a remote host.
admin.create_superuser Example: fab prod admin.create_superuser:ubuntu
admin.create_user Require a user and its home directory by default.
admin.setup Require some Debian/Ubuntu/Python packages
admin.sudoer Require sudo permissions for a given user.
backend.checkout Deploy the application source code.
backend.clean Remove the project repository.
backend.managepy Run the manage.py command inside the virtual environment.
backend.reload_servers Update the configuration and restart processes.
backend.requirements Require Python, the latest source code version, and all dependencies.
backend.restart_runserver Restart the workers of the main application.
db.clean Remove a database and its user.
db.create_db Create a PostgreSQL database.
db.create_user Create a database user
db.drop_db Drop a database if it exists.
db.drop_user Drop a user if one exists
db.init Run the first migration.
db.migrate Run all migration scripts.
db.reset Recreate a db and its user.
deploy.all Deploy a frontend, a backend and system packages.
deploy.clean Remove backend and frontend requirements.
frontend.clean Remove frontend requirements.
frontend.collectstatic Collect and compress static files
...

Price : 400

Country : Ukraine

Tags : deployment django nginx fabric python

Published : 7 years ago

Write To Developer