I’m setting up Bedrock for the first time and there are a couple things that aren’t clear to me:
Are the Capistrano config files (deploy.rb, staging.rb, and production.rb) complete in the sense that all I have to do is add my specific server settings and they’ll work? Or, do I need to add more rules to them?
Is Composer only run on the dev environment? Or, is it also run on the staging and production servers?
They’re mostly complete. You just need to fill out app name, repo url, and server settings like host, user and auth methods.
Composer is run on any environment you have in Capistrano by default. Most people don’t actually “deploy” to a dev environment though. Composer is required in the
Capfile here https://github.com/roots/bedrock/blob/master/Capfile#L8 which hooks into cap’s deploy flow by doing:
before 'deploy:updated', 'composer:install'.
The current Cap configs are designed to be mostly complete for a default workflow. Obviously if you have anything more complex/custom behaviour, or are using it some kind of managed/shared host, you may need to customize them more.
Thanks, that makes sense.
I was thinking Capistrano packaged everything locally and then deployed that to the servers.
I have it all set up and it appears to be working, but I’m having trouble wrapping my head around some of the stuff Capistrano does and there’s not much documentation for v3.0.
Where is this bit actually defined?
before 'deploy:updated', 'composer:install'
It’s in the Composer plugin (gem) found here: https://github.com/capistrano/composer/blob/master/lib/capistrano/tasks/composer.rake#L60 so it’s done automatically if you
You could think of it just like a WordPress plugin that hooks into some action.