UPDATE: See Switching from bower to composer with components for a better solution.
Today I wanted to deploy a new Symfony2 app I’m working on.
In this app I’m using the SPBowerBundle to use the bower package manager for all the 3rd party frontend code, like Twitter Bootstrap, Jquery and Jqplot.
Capifony normally works great for deploying symfony2 apps (if you’re not using it, you should check it out!), but this time it didn’t.
The setup of the SPBowerBundle is very straightforward, but if you want to deploy it with capifony you need to setup a few things that aren’t really obvious.
1) As Capifony by default does not run the scripts included by Composer, step 6 of the SPBowerBundle of the installation manual doesn’t work. Instead you need to add the following to your deploy.rb:
1 2 3 4 5 6 7 8 9 10 11 12 |
|
Before the cache is warmed up, the SPBowerBundle installs the specified assets, so they are available for the specified assetic filters.
2) Make sure you setup the cache warmup of the SPBowerBundle, step 7
1 2 3 |
|
as otherwise you get the following error:
1 2 |
|
If you did that, and you still get the above mentioned exception, copy your components.json to your server and try a bower install on it. If that works, it’s a configuration issue in capifony, if not, then you should check your bower install.