Skip to content

Latest commit

 

History

History
65 lines (43 loc) · 1.7 KB

README.md

File metadata and controls

65 lines (43 loc) · 1.7 KB

Capistrano Rake tasks

Useful Capistrano Rake tasks for WordPress. Currently:

Varnish

varnish:clear

Clears the varnish cache. Has support for Multiple domains (via Multisite). See Config.

Assets

Used to build and upload front-end assets. Assumed configuration variables: theme and assets.

assets:upload

Builds and uploads assets.

assets:build

Builds assets with npm run build in the :theme directory.

Config (assets)

Theme

A theme directory should be set. This is used to run build the assets. For example, for bedrock:

set :theme, 'web/app/themes/<my-theme>'
Asset directories

You can specify assets directories from within the theme directory. These asset folders will be uploaded after building the assets. For example:

set :assets, fetch(:assets, []).push('assets/scripts/dist')
set :assets, fetch(:assets, []).push('assets/styles/dist')

Automation

To automatically build and upload assets on each deployment, you can use the deploy:updated hook:

after "deploy:updated", "assets:upload"

Domains

domains:map

Maps domains for the WordPress MU Domain Mapping plugin when pulling the database.

Config (domains)

Domains can be configured by setting the domains variable. For example, in production.rb:

set :domains, {
  'www.example.com' => 'www.example-com.localhost',
  'www.example.org' => 'www.example-org.localhost',
}