Best way to deploy Apostrophe 0.0.5 & 2.0.0 autogenerated files to a cloud provider or similar?

77 views Asked by At

This questions relates to both, version 0.0.5 and 2.0.0. Apostrophe generates a single hashed .css file and corresponding .js when minify is set to true.

We are looking to be able to deploy these files to an s3 bucket or similar and have them hosted from there. The way I see the process likely to be is:

  • Let apostrophe generate the files, or use some type of command line to generate these files
  • Upload the files with some other task to s3
  • Hook somehow into the nunjucks helpers that output the css and js link to include the s3 address ( This could also be useful for just changing the URL to cloudfront)

These step should be run as a pre-task to any deployment action, so that once the new version is started these files are already in place.

I know that 2 calls for 2 static assets is not going to kill the nginx server, however I would prefer having them hosted on a cloud provider.

I would like to ask if this is somehow already handled, and if not, how is it handled in production deployments of A2 at the moment.

2

There are 2 answers

3
Alex Gilbert On

The Deploying Apostrophe in the Cloud HOWTO should cover most of these items.

0
Tom Boutell On

An updated answer: Apostrophe 2.x now supports generating bundles for deployment to S3. The updated deploying Apostrophe in the cloud HOWTO now covers this.