This Page

woven.deployment

woven.deployment.deploy_files(local_dir, remote_dir, pattern='', rsync_exclude=['*.pyc', '.*'], use_sudo=False)

Generic deploy function for cases where one or more files are being deployed to a host. Wraps around rsync_project and stages files locally and/or remotely for network efficiency.

local_dir is the directory that will be deployed.

remote_dir is the directory the files will be deployed to. Directories will be created if necessary.

Note: Unlike other ways of deploying files, all files under local_dir will be deployed into remote_dir. This is the equivalent to cp -R local_dir/* remote_dir.

pattern finds all the pathnames matching a specified glob pattern relative to the local_dir according to the rules used by the Unix shell. pattern enhances the basic functionality by allowing the python | to include multiple patterns. eg ‘.txt|Django

rsync_exclude as per rsync_project

Returns a list of directories and files created on the host.

woven.deployment.mkdirs(remote_dir, use_sudo=False)

Wrapper around mkdir -pv

Returns a list of directories created

woven.deployment.upload_template(filename, destination, context={}, use_sudo=False, backup=True, modified_only=False)

Render and upload a template text file to a remote host using the Django template api.

filename should be the Django template name.

context is the Django template dictionary context to use.

The resulting rendered file will be uploaded to the remote file path destination (which should include the desired remote filename.) If the destination file already exists, it will be renamed with a .bak extension.

By default, the file will be copied to destination as the logged-in user; specify use_sudo=True to use sudo instead.