Package: aja
AjaAja providesFabrictasks for deployingbuildoutsfrom staging server to
remote production servers:it assumes buildout with absolute path (this is the buildout default)it assumes that all the relevant paths (python, buildout, shared eggs, etc)
are identical for the staging and production serversbootstrap and buildout are always run on the staging server onlybuildout is deployed by pushing its bin-, parts- and (local or shared)
eggs-directories into the remote production server using rsyncInstallationAja can be installed like any Python package:$pipinstallajaBut be aware that Aja comes with the following dependenciesFabricparamikozc.buildoutsetuptoolsecdsapycryptoand therefore, it’s recommended to use a dedicated virtualenv.Aja doesn’t have it’s own executable, but is executed using Fabric’sfabcommand. Of course, it is possible to symlink that asaja.ConfigurationAja is configured with a fabfile, e.g.fabfile.py:importfabric.apifabric.api.env.update({'buildout_directory_prefix':'',# optional'buildout_extends_prefix':'',# optional})fromaja.tasksimport*buildout_directory_prefixprovides optional convenience when creating new
buildouts or when looking for buildouts for the other commands.buildout_extends_prefixprovides optional convenience when creating new
buildout.UsageAja maps Fabric’s hosts into buildouts so that for each buildout, it fillsfabric.api.envwith variables from[aja]part in the buildout (this is
quite similar tocollective.hostout). The rest of the resolved buildout file
can be found atfabric.api.env.buildout.An example[aja]part could look like:[aja]executable=/usr/local/python/bin/pythonhost_string=buildout@productionkey_filename=/home/buildout/.ssh/id_rsaThis part would configure Aja tasks to use particular Python virtualenv for
running the buildout
and
push the results into serverproductionby performing rsync using the
given key file.Example Aja usage could look like:$fabcreate:/var/buildout/plone,/vagrant/plone-4.3.cfg$fab-H/var/buildout/plonebuildoutpushAnd with the following convenience configuration in fabfile:importfabric.apifabric.api.env.update({'buildout_directory_prefix':'/var/buildout','buildout_extends_prefix':'/vagrant',})fromaja.tasksimport*The previous example usage could look like:$fabcreate:plone,plone-4.3.cfg$fab-HplonebuildoutpushNotebuildout_extends_prefixcan also be an URL likehttp://myserver/buildouts/ExtendingAja provides only the most basic fabric tasks, but it provides a custom
task classaja.tasks.AjaTask, which provides resolved buildout
atfabric.api.env.buildout. This makes it easy to define custom tasks
in your fabfile, e.g.fromfabricimportapifromfabric.operationsimportrunfromaja.tasksimportAjaTask@task(task_class=AjaTask)defpurge():buildout_bin=api.env.buildout['buildout'].get('bin-directory')buildout_parts=api.env.buildout['buildout'].get('parts-directory')run('rm -rf{0:s}'.format(buildout_bin))run('rm -rf{0:s}'.format(buildout_parts))purge.__doc__=\"""Clean bin- and parts-directories (e.g. before push)
    """Changelog0.9.2 (2017-05-10)Add support for bootstrap cmd to read setuptools and zc.buildout versions
from buildout
[datakurre]0.9.1 (2016-04-26)Add aja-alias for fabric as a console script
[datakurre]0.9.0 (2015-01-14)First release.