Synching deploys

Our Rails app needs to sync the deployment of several bits:

  • web service – the dynamic application
  • assets – static site with the assets (because web doesn’t do CDN yet)
  • cron – for the async work

Pushing to a deployment branch can trigger these three autodeploys, however, if web fails to deploy, the other two would end up on a different commit.

Or the web deployment could call the trigger URLs of assets and cron. If any of those fails to build, things are out of sync as well. Furthermore, sequential builds mean that for quite some time, the different parts are equally out of sync.

Is there a best practice how to mitigate this?

Update: Is there maybe a way to build the web service and then use the same image for cron and the static site? It’s not really necessary to do separate builds for web, assets and cron and only shipping one built image would greatly reduce the out of sync time as well as the risk of static or cron builds failing e.g. due to transient problems.