Skip to content

trendwerk/capistrano-rake-tasks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

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',
}

Releases

No releases published

Packages

No packages published

Languages