I am a newbie to this Capistrano deployment concept. Few questions:
Since Capistrano is based on Ruby, does the production server need to have Ruby installed as well?
“Deploying WordPress with Capistrano” article has warning on Capistrano can’t deploy to a shared host server. So I have to get a dedicated server or VPS to make this deployment approach works?
WP has auto update feature after V 3.9. I understand that Capistrano will modify default WP file structure. When auto updates triggered in production server, does it still work?
Similar question to 3 - when I update a plugin directly in production server via WP admin plugin updates, does it gonna work? Or it needs a different plugin update approach?
@cfx is mostly correct with the above with some clarification:
Ditto (Ruby is only required locally).
Capistrano doesn’t modify anything by default. Only if you want to use a non-standard setup like Bedrock.
Using Capistrano doesn’t mean you have to use Bedrock or Composer. But Capistrano ALWAYS (by default) deploys from a Git repository. If you update a plugin on production it’s just a local modification and won’t be reflected in your repo. Unless you commit things on production but that’s insane.
So if you use Capistrano to deploy: never change anything in production that results in local modifications and that includes installing plugins from WP admin.
@swalkinshaw speaks the truth. Thanks for clarifying!
Thanks for clarifications, @cfx and @swalkinshaw!
Since you mentioned Bedrock, if I use Composer to set up WP initially, which will modify the default WP file structure, does that mean auto update of WP will break it?
I understand that Composer uses WordPress Packagist to install plugins and themes. What the plugins or themes that not in the repo? (like commercial plugins or themes)
Bedrock uses a modified folder structure but WP core is completely intact. We just disable auto-updates since you update WP itself through Composer. Even if you enabled auto-update I don’t think it would break anything. The update just wouldn’t be reflected in your Git repository since it only happened on the production server.
Do you mean plugins/themes that aren’t in WP plugin directory? Composer can pull from WPackagist, normal Packagist, any custom Git/SVN repository, zip file, etc. I suggest searching this forum for other Composer topics like Best way to install private/paid plugins with Composer?.
There’s this post as well: http://roots.io/wordpress-plugins-with-composer/
Just to add another way of thinking about it: Bedrock allows you to update WordPress from the dashboard as usual.
If you do this in your production environment without changing the WP version number in
composer.json then any Capistrano deploy you perform to the production environment will install the (potentially outdated) WP version specified in that file. You will, of course, be able to update from the production dashboard, but simply updating the version number in
composer.json will save you this step.
Likewise, if you update your local WP version from within your WP dashboard and find yourself running Composer in your local environment, you may end up needing to update WP again if you did not update the version number in
As @swalkinshaw said, the latest WP version won’t be “in” your Git repo unless it’s specified in
composer.json and then committed to your repo. So, if someone clones your Git repo and runs Composer to install WP and plugins they will start out with an outdated WP version unless you change the version number in
composer.json and commit the change to your repo. However, they should have no problem updating it from the WP dashboard if you forget to update