Deploy assets to Digital Ocean space CDN
Install using composer:
composer require ekyna/digital-ocean-bundle
Register the bundle:
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = [
// ...
new Ekyna\Bundle\DigitalOceanBundle\EkynaDigitalOceanBundle(),
];
}
}
Add the configuration:
ekyna_digital_ocean:
api:
token: YOUR_API_TOKEN
spaces:
-
name: my-do-cdn # Must match space name on Digital Ocean
region: ams3
key: SPACE_ACCESS_KEY
secret: SPACE_ACCESS_SECRET
usage:
bundles: my-do-cdn # The space to use for assets deployment
Spaces storages are available as League\Flysystem\Filesystem (v1) services :
<!-- You can inject 'my-do-cdn' filesystem service -->
<service id="Acme\Some\Service">
<argument type="service">ekyna_digital_ocean.my_do_cdn.filesystem</argument>
</service>
You can deploy bundles assets to your space CDN by running the following command:
php bin/console ekyna:digital-ocean:assets:deploy
Warning: it purge the entire CDN cache.