Client Side AssetsΒΆ

Often projects need to pre-compile assets at or just before deploy time to be uploaded to the remote host. The config.py file is a perfect place to perform this kind of thing as it will be loaded once and before any remote connections are made.

# config.py

from pyinfra import local, logger

logger.info('Running yarn install & build')

local.shell('yarn install')
local.shell('yarn run build')

Simply place this config.py alongside your deploys and pyinfra will pick it up.