Capistrano-Bedrock, keeping plugins synced

I had trouble getting Composer installed on my shared server (although I eventually did)

But there’s a lot of strange things happening in regards to my plugins folder and I’m wondering what the “normal” way of doing things is.

Should the plugins folder be…
in the git repository?
listed as a shared folder in the deploy.rb settings?

set :linked_dirs, fetch(:linked_dirs, []).push('web/app/uploads', 'web/app/plugins')

should composer install be running with each cap deploy (pretty sure it’s not) ?

I noticed that I’m not able to upload plugins via the wordpress admin interface anymore? Is this a function of using the plugins in a shared folder?

Just wondering what the normal approach to this is, if there is one.

Cheers!

app/plugins is Git ignored by default in Bedrock. So yes it’s normal that you won’t see it in the Git repo.

Composer should be running on deploys automatically. Are you using https://github.com/roots/bedrock-capistrano? It has the capistrano-composer gem added which takes care of that for you.

Bedrock also disabled file edits in production by default so that means you can’t upload plugins in the admin. See here.

Feel free to change that if you want. However, the intention of Bedrock is to have Composer manage your plugins so they shouldn’t be in source control.

1 Like

@swalkinshaw Thanks, that clears a lot up.

That makes me think, then, that I must be installing plugins the wrong way on my local site- such that they’re not written to the composer.json file and never installed on the deploy.

Is it typical to use something other than the wp-admin screen to install plugins when developing locally? Wp-cli?

Composer does appear to run successfully on each deploy …

INFO[fe503be0] Running /home/nnnnnnn/bin/composer.phar install --no-dev --prefer-dist --no-interaction --quiet --optimize-autoloader on s313.rackspeed-cloud.de
DEBUG[fe503be0] Command: cd /home/nnnnnnn/www/staging/releases/20160311155252 && ( WP_ENV=staging /home/nnnnnnn/bin/composer.phar install --no-dev --prefer-dist --no-interaction --quiet --optimize-autoloader )
INFO[fe503be0] Finished in 1.706 seconds with exit status 0 (successful)

The workflow for adding a plugin is:

  1. composer require <plugin>
  2. Commit both the composer.json and composer.lock files
  3. Push commit to Git repo
  4. Deploy as usual

The key is to commit the updated composer.lock file.