New in version 2.5: Starting in this release, Pootle includes Fabric deployment scripts.
The sample Fabric scripts provide several commands that you can use to easily deploy your Pootle site.
Note
Most of the examples in this section will use the production
environment, but remember that other environments can be used as well.
Please read first the How to run Fabric commands section in order to know how this commands can be run. Reading the Typical Usage Example section might be helpful as well.
This command:
requirements/
,
including the base requirements as wellNote
While running it may ask for the remote server root
password,
or more likely the sudo
password, which is the standard password for the
remote user configured in the environment.
Note
Changed in version 2.5.1: Added support for bootstrapping from a given branch on Pootle repository.
Examples:
$ fab production bootstrap # Call that will use the default 'master' branch
$ fab production:branch=stable/2.5.0 bootstrap # Call which provides a branch
This command:
Examples:
$ fab production compile_translations
New in version 2.5.1.
This command:
Note
While running it may ask for the remote server root
password or
the sudo
password (standard password for the remote user configured in
the environment) as well as the specified db_user
and/or database root
password. See the mysql_conf command
for a way to eliminate the need for database password prompting.
Note
This command will try to create a database on MySQL, which will fail if MySQL is not installed or the settings don’t provide configuration data for creating the database.
Examples:
$ fab production create_db
This command:
Note
While running it may ask for the remote server root
password or
the sudo
password (standard password for the remote user configured in
the environment).
Note
Changed in version 2.5.1: Added support for deploying from a given branch on Pootle repository.
Examples:
$ fab production deploy # Call that will use the default 'master' branch
$ fab production:branch=stable/2.5.0 deploy # Call which provides a branch
This command:
pootle/assets/
directory if it does not existExamples:
$ fab production deploy_static
This command:
Note
While running it may ask for the remote server root
password or
the sudo
password (standard password for the remote user configured in
the environment).
Examples:
$ fab production disable_site
New in version 2.5.1.
This command:
Note
While running it may ask for the remote server root
password or
the sudo
password (standard password for the remote user configured in
the environment) as well as the specified db_user
and/or database root
password. See the mysql_conf command
for a way to eliminate the need for database password prompting.
Examples:
$ fab production drop_db
New in version 2.5.1.
This command:
Note
While running it may ask for the remote server root
password or
the sudo
password (standard password for the remote user configured in
the environment) as well as the specified db_user
and/or database root
password. See the mysql_conf command
for a way to eliminate the need for database password prompting.
Note
This commands can be used to perform periodic backups, that can be imported later using the load_db command.
Available arguments:
dumpfile
The local filename for the file where the database will be dumped.
Default: pootle_DB_backup.sql
.
Examples:
$ fab production dump_db # Call that will use the default filename
$ fab production dump_db:dumpfile=backup_mysql.sql # Call which provides a filename
This command:
Note
While running it may ask for the remote server root
password or
the sudo
password (standard password for the remote user configured in
the environment).
Examples:
$ fab production enable_site
New in version 2.5.1.
This command:
Examples:
$ fab production initdb
This command:
Note
While running it may ask for the remote server root
password or
the sudo
password (standard password for the remote user configured in
the environment).
Examples:
$ fab production install_site
New in version 2.5.1.
This command:
Note
While running it may ask for the remote server root
password or
the sudo
password (standard password for the remote user configured in
the environment) as well as the specified db_user
and/or database root
password. See the mysql_conf command
for a way to eliminate the need for database password prompting.
Note
You must first create the database you will import (e.g. using the create_db command) before calling this command,
Available arguments:
dumpfile
The local SQL dump filename that will be uploaded to the remote server and imported into an existing database on the remote server. This file can be created using the dump_db command.
Note
This is a required argument.
Examples:
$ fab production create_db # Remember to create the DB first
$ fab production load_db:dumpfile=backup_mysql.sql
New in version 2.5.1.
This command:
Examples:
$ fab production migratedb
New in version 2.5.1.
This command creates a .my.cnf
MySQL options file on the remote system
with the password(s) for database access stored in them (the passwords are
taken from the fabric.py
settings file). Once you have done this, you
can un-comment the alternate db_password_opt
and db_root_password_opt
settings in fabric.py
, which will eliminate the need for password
prompting on all MySQL operations.
Examples:
$ fab production mysql_conf
This command:
production
environment in Fabric
settingsNote
This command is useless unless it is called before another command or commands.
Note
This command allows changing the settings. To do so just pass it any of its arguments when calling it.
Note that some commands might require passing any or all of these arguments
to this command in order to overwrite the default settings before calling
those commands. For example the command stage_feature requires
passing branch
, repo
and feature
.
Note
Changed in version 2.5.1: Added support for altering the settings based on the passed arguments.
Available arguments:
branch
repo
A repository URL to clone from.
This allows to checkout from a fork repository (not necessarily on GitHub)
and try new features developed on that repository. It must be an URL that the
git clone
command is able to clone.
feature
Examples:
$ fab production bootstrap
In the previous example production is called to set up the environment for calling bootstrap afterwards.
$ fab production:branch=feature/extension-actions bootstrap
In the previous example production is called to set up the environment for calling bootstrap afterwards.
The branch
argument overwrites the default branch in the settings,
which are then used for all the subsequent commands (just bootstrap
in this example).
$ fab production:branch=feature/extension-actions,repo=git://github.com/unho/pootle.git bootstrap
In the previous example production is called to set up the environment for calling bootstrap afterwards.
The branch
and repo
arguments overwrite the default
settings, which are then used for all the subsequent commands (just
bootstrap in this example).
$ fab production:branch=feature/extension-actions,repo=git://github.com/unho/pootle.git,feature=yes stage_feature
This example is like the previous one, with the addition of the
feature
argument that triggers the altering of several settings. That
altering is necessary for working with feature-staging servers.
New in version 2.5.1.
This command:
Examples:
$ fab production setup
New in version 2.5.1.
This command:
Examples:
$ fab production setup_db
New in version 2.5.1.
This command:
Note
While running it may ask for the remote server root
password and
the specified db_user
password.
Note
This command is intended primarily for deploying ad-hoc Pootle servers for easing the test of feature branches during Pootle development.
Warning
This command might require changing the source_db field in the
deploy/ENVIRONMENT/fabric.py
file. Note that the database specified
on this field must exist.
Warning
This command requires using the staging
environment passing to
it the feature
argument, the desired branch and optionally a
repository URL.
Examples:
$ fab staging:branch=feature/extension-actions,feature=yes stage_feature
$ fab staging:branch=feature/extension-actions,repo=git://github.com/unho/pootle.git,feature=yes stage_feature
This command:
staging
environment in Fabric settingsNote
This command is useless unless it is called before another command or commands.
Note
This command allows changing the settings. To do so just pass it any of its arguments when calling it.
Note that some commands might require passing any or all of these arguments
to this command in order to overwrite the default settings before calling
those commands. For example the command stage_feature requires
passing branch
, repo
and feature
.
Note
Changed in version 2.5.1: Added support for altering the settings based on the passed arguments.
Available arguments:
branch
repo
A repository URL to clone from.
This allows to checkout from a fork repository (not necessarily on GitHub)
and try new features developed on that repository. It must be an URL that the
git clone
command is able to clone.
feature
Examples:
$ fab staging bootstrap
In the previous example staging is called to set up the environment for calling bootstrap afterwards.
$ fab staging:branch=feature/extension-actions bootstrap
In the previous example staging is called to set up the environment for calling bootstrap afterwards.
The branch
argument overwrites the default branch in the settings,
which are then used for all the subsequent commands (just bootstrap
in this example).
$ fab staging:branch=feature/extension-actions,repo=git://github.com/unho/pootle.git bootstrap
In the previous example staging is called to set up the environment for calling bootstrap afterwards.
The branch
and repo
arguments overwrite the default
settings, which are then used for all the subsequent commands (just
bootstrap in this example).
$ fab staging:branch=feature/extension-actions,repo=git://github.com/unho/pootle.git,feature=yes stage_feature
This example is like the previous one, with the addition of the
feature
argument that triggers the altering of several settings. That
altering is necessary for working with feature-staging servers.
New in version 2.5.1.
This command:
Examples:
$ fab production syncdb
This command:
Examples:
$ fab production touch
New in version 2.5.1.
This command:
Note
While running it may ask for the remote server root
password and
the specified db_user
password.
Note
This command is intended for removing Pootle deployments performed using the stage_feature command.
Warning
This command requires using the staging
environment passing to
it the feature
argument and the desired branch.
Examples:
$ fab staging:branch=feature/extension-actions,feature=yes unstage_feature
This command:
requirements/
,
including the base requirements as wellNote
Changed in version 2.5.1: Added support for updating code from a given branch on Pootle repository.
Examples:
$ fab production update_code # Call that will use the default 'master' branch
$ fab production:branch=stable/2.5.0 update_code # Call which provides a branch
This command:
virtualhost.conf
pootle.wsgi
settings.conf
Note
While running it may ask for the remote server root
password or
the sudo
password (standard password for the remote user configured in
the environment).
Examples:
$ fab production update_config
New in version 2.5.1.
This command:
Examples:
$ fab production upgrade