Capistrano::Wearerequired is a collection of recipes and tasks specialized on WordPress deployment.
-
Add this line to your application's Gemfile to install the latest stable version:
gem 'capistrano-wearerequired', '~> 2.0'
-
Execute:
$ bundle
-
Require the library in your application's Capfile:
require 'capistrano/wearerequired'
The class SlackistranoMessagingElements
allows to change the icon with an emoji or image URL and to define a custom username.
Example:
set :slackistrano, {
klass: Capistrano::Wearerequired::SlackistranoMessagingElements,
channel: '#your-channel',
webhook: 'your-incoming-webhook-url',
icon_emoji: ':ship:',
username: 'deploybot'
}
The class SlackistranoMessagingColors
adds colors to the deploy messages posted to Slack. SlackistranoMessagingColors
extends SlackistranoMessagingElements
.
Example:
set :slackistrano, {
klass: Capistrano::Wearerequired::SlackistranoMessagingColors,
channel: '#your-channel',
webhook: 'your-incoming-webhook-url'
}
The class SlackistranoExpandedGitMessaging
adds a link to the current diff, the current revision and branch, the name of the deployer and suppresses update messages. SlackistranoExpandedGitMessaging
extends SlackistranoMessagingColors
.
Example:
set :slackistrano, {
klass: Capistrano::Wearerequired::SlackistranoExpandedGitMessaging,
channel: '#your-channel',
webhook: 'your-incoming-webhook-url',
}
See Customizing the Messaging for more information.
To delete all content from Composer's cache directories run:
cap staging composer:clear_cache
To clean up all old releases but the last run:
cap staging deploy:cleanup_all
To install WordPress translations set :wp_language
and run:
set :wp_languages, [
'de_DE',
'it_IT
]
cap staging wordpress:install_translations
To update WordPress translations run:
cap staging wordpress: update_translations
To clear OPcache of your site set :wp_clear_opcache, true
and run:
cap staging wordpress:clear_opcache
(Requires the WP-CLI Clear OPcache plugin.)