Skip to content

Allow optional customizable post-deploy jobs in default chart

When deploying systems using the default auto-deploy-app chart, we occasionally need to queue long-running processes as part of the deployment. We've been handling this manually after the application upgrade has been completed by connecting a terminal to a pod and manually triggering a command that queues the jobs.

Our system has a mechanism for automatically ensuring deployment jobs get queued, but we can't hook of the DB_MIGRATE command because old workers may pick up the jobs before the rollout is completed.

Our options in this case are limited to creating a completely custom helm chart (and maintaining it) just to add a single post-upgrade job.

It would be ideal if auto-deploy-image would have some way of merging in custom chart templates from the repo, as an alternative to a fully custom chart. I.e., taking ASSETS_CHART_DIR as a base chart, then copying any templates in a repos chart/templates directory (e.g.,) AUTO_DEVOPS_TEMPLATES into the auto-deploy-image's chart/templates. This would allow for much wider customisation of the default chart, without requiring complete maintenance of a fully custom chart.

I'd be happy to raise a MR with this change if it was something useful to others.

Failing that it would be extremely useful to include a post-upgrade-job.yaml template as a post-upgrade helm hook in the default chart that we can optionally configure E.g., .Values.application.postUpgradeCommand.

This would allow us to run commands immediately after deployment.