assembl.fabfile module

This file specifies how to do a number of installation tasks for Assembl. It uses the Fabric (1.13) remote executor. In most projects, it is separate from the code package, but many tasks need to be executed in an environment when only the assembl package is available. Some of the tasks also need to be executed before assembl is installed. The fab command can take a path to this file with the -f flag, and this file can also work well if invoked through a symbolic link.

assembl.fabfile.app_compile[source]

Full Update: This is what you normally run after a git pull. Doesn’t touch git state, but updates requirements, rebuilds all generated files annd restarts whatever needs restarting. You need internet connectivity. If you are on a plane, use app_compile_noupdate instead.

assembl.fabfile.app_compile_nodbupdate[source]

Separated mostly for tests, which need to run alembic manually

assembl.fabfile.app_compile_noupdate[source]

Fast Update: Doesn’t touch git state, don’t update requirements, and rebuild all generated files. You normally do not need to have internet connectivity.

assembl.fabfile.app_create_wheel[source]

Create a wheel for assembl. Should be run locally.

assembl.fabfile.app_db_install()[source]

Install db the first time and fake migrations

assembl.fabfile.app_db_update[source]

Migrates database using south

assembl.fabfile.app_fullupdate[source]

Full Update: Update to latest git, update dependencies and compile app. You need internet connectivity, and can’t run this on a branch.

assembl.fabfile.app_majorupdate[source]

This update is so major that assembl needs to be put in maintenance mode. Only for production.

assembl.fabfile.app_reinstall_all_dependencies[source]

Reinstall all python and javascript dependencies. Usefull after a OS upgrade, node upgrade, etc.

assembl.fabfile.app_reload[source]

Restart all necessary processes after an update

assembl.fabfile.app_update[source]

Fast Update: Update to latest git, compile app but don’t update requirements Useful for deploying hotfixes. You need internet connectivity, and can’t run this on a branch.

assembl.fabfile.app_update_dependencies[source]

Updates all python and javascript dependencies. Everything that requires a network connection to update

assembl.fabfile.bootstrap[source]

Creates the virtualenv and install the app from env URL

takes the same arguments at env_dev, but projectpath is mandatory

assembl.fabfile.bootstrap_from_checkout[source]

Creates the virtualenv and install the app from git checkout

assembl.fabfile.bootstrap_from_wheel[source]

Creates the virtualenv and install the app from git checkout

assembl.fabfile.build_doc[source]

Build the Sphinx documentation

assembl.fabfile.build_virtualenv[source]

Build the virtualenv

assembl.fabfile.check_and_create_database_user[source]

Create a user and a DB for the project

assembl.fabfile.circus_process_start(process_name)[source]

Starts a circusd process, and waits till it started to return

assembl.fabfile.circus_process_stop(process_name)[source]

Assuming the circusd process is running, stop one of its processes

assembl.fabfile.circus_restart[source]

Restart circusd itself.

assembl.fabfile.clone_repository()[source]

Clone repository

assembl.fabfile.combine_rc(rc_filename, overlay=None)[source]

Take a rc filename, load it as fabric would.

If it specifies an _extends value, consider this file to be an overlay of the named file.

assembl.fabfile.compile_fontello_fonts[source]

Compile the fontello fonts once you have edited them in Fontello. Run start_edit_fontello_fonts first.

assembl.fabfile.compile_messages[source]

Run compile *.mo file from *.po

assembl.fabfile.compile_stylesheets_and_js[source]

Generates and minifies stylesheets and javascript

assembl.fabfile.compile_widget_stylesheets[source]

Generate *.css files from *.scss in widgets

assembl.fabfile.create_local_ini[source]

Replace the local.ini file with one composed from the current .rc file

assembl.fabfile.create_sentry_project[source]

Create a project for the current assembl server. Mostly useful for Docker. Tested on Sentry 8.

assembl.fabfile.database_create[source]

Create the database for this idealoom instance

assembl.fabfile.database_delete[source]

Deletes the database instance

assembl.fabfile.database_download[source]

Dumps and downloads the database from the target server

assembl.fabfile.database_dump[source]

Dumps the database on remote site

assembl.fabfile.database_restore[source]

Restores the database backed up on the remote server

assembl.fabfile.database_upload[source]

Uploads a local database backup to the target environment’s server

assembl.fabfile.docker_compose[source]

Create configuration files needed by docker_compose

assembl.fabfile.docker_startup[source]

Startup assembl from within a docker environment.

Verify if your database environment exists, and create it otherwise.

assembl.fabfile.ensure_requirements[source]

Copy the appropriate frozen requirements file into requirements.txt

assembl.fabfile.filter_global_names(rc_data)[source]

Returns a copy of the dict with normalized key names. Some keys in rc files are prefixed with * or _ for ini conversion purposes, those are stripped. If the value is ‘__delete_key__’, the pair is filtered out.

assembl.fabfile.flushmemcache[source]

Resetting all data in memcached

assembl.fabfile.generate_certificate[source]

Generate a certificate for https, and add renewal to crontab

assembl.fabfile.generate_dh_group[source]

Generate Diffie-Hellman Group

assembl.fabfile.generate_frozen_requirements[source]

Generate all frozen requirements file

assembl.fabfile.generate_new_requirements[source]

Generate frozen requirements.txt file (with name taken from environment).

assembl.fabfile.install_assembl_deps[source]

Will install commonly needed build deps for pip django virtualenvs.

assembl.fabfile.install_assembl_server_deps[source]

Will install most assembl components on a single server, except db

assembl.fabfile.install_basetools()[source]

Install required base tools

assembl.fabfile.install_certbot[source]

Install letsencrypt.org certbot

assembl.fabfile.install_database[source]

Install a postgresql DB server

assembl.fabfile.install_dovecot_vmm[source]

Install dovecot and vmm for IMAP. Assumes postfix is installed. Configuration TODO.

assembl.fabfile.install_lamp[source]

Installs Apache2, Mysql and PHP on a Linux Environment

assembl.fabfile.install_memcached[source]

Install memcached server

assembl.fabfile.install_piwik[source]

Install the entire Piwik stack on Linux systems ONLY

assembl.fabfile.install_postfix[source]

Install postfx for SMTP.

assembl.fabfile.install_pyftpsync[source]

Install pyftpsync.

Useful in case of syncing a local borg backup to a remote FTP server.

assembl.fabfile.install_redis[source]

Install redis server

assembl.fabfile.install_server_deps[source]

Tools needed by server in order to operate securely and cleanly, but not related to Assembl

assembl.fabfile.install_single_server[source]

Will install all assembl components on a single server. Follow with bootstrap_from_checkout

assembl.fabfile.install_yarn(local=True)[source]

Install yarn

assembl.fabfile.load_rcfile_config()[source]

Load the enviroment from the .rc file.

assembl.fabfile.make_messages[source]

Run *.po file generation for translation

assembl.fabfile.migrate_local_ini[source]

Generate a .rc file to match the existing local.ini file. (requires a base .rc file)

This should be used only once, to migrate from a hand-crafted local.ini to the new generated local.ini system.

assembl.fabfile.postgres_user_detach[source]

Terminate the PID processes owned by the assembl user

assembl.fabfile.printenv()[source]

Print shell env

assembl.fabfile.reset_semantic_mappings[source]

Reset semantic mappings after a database restore

assembl.fabfile.rotate_database_dumps[source]

Rotate database backups for real

assembl.fabfile.rotate_database_dumps_dry_run[source]

Rotate database backups dry run

assembl.fabfile.sanitize_env()[source]

Ensure boolean and list env variables are such

assembl.fabfile.set_fail2ban_configurations[source]

Utilize configurations to populate and push fail2ban configs, must be done as a sudo user

assembl.fabfile.set_file_permissions[source]

Set file permissions for an isolated platform environment

assembl.fabfile.start_edit_fontello_fonts[source]

Prepare to edit the fontello fonts in Fontello.

assembl.fabfile.tests()[source]

Run all tests on remote

assembl.fabfile.uninstall_lamp[source]

Installs Apache2, Mysql and PHP on a Linux Environment, for dev purposes

assembl.fabfile.uninstall_piwik[source]

Remove all dependencies and configurations related to Piwik on Linux

assembl.fabfile.update_bower_requirements[source]

Normally not called manually

assembl.fabfile.update_node[source]

Install node and npm to a known-good version

assembl.fabfile.update_npm_requirements[source]

Normally not called manually

assembl.fabfile.update_pip_requirements[source]

update external dependencies on remote host

assembl.fabfile.update_python_package_builddeps[source]

Install/Update python package native binary dependencies

assembl.fabfile.update_vendor_config[source]

Update the repository of the currently used config file

assembl.fabfile.update_vendor_themes[source]

Update optional themes in assembl/static/css/themes/vendor

assembl.fabfile.updatemaincode()[source]

Update code and/or switch branch

assembl.fabfile.webservers_reload[source]

Reload the webserver stack.

assembl.fabfile.webservers_start()[source]

Start all webservers

assembl.fabfile.webservers_stop()[source]

Stop all webservers