Skip to content

WIP: support complex helm charts for autodevops

What does this MR do?

In short, this MR supports using helm charts for review apps that include several dependencies, one of which is the current project.

I ran into a problem trying to set up auto devops. We have an application stack that consists of several microservices. Each microservice has its own helm chart living side-by-side with the source code for that microservice. We also have an application helm chart that uses dependencies to pull in the microservices and other required infra.

I would like to use review apps to deploy an entire application stack when dev'ing against any of the microservices. Currently, that is impossible with just stock auto devops; it will merely use the image tags that are in the application helm chart, and not use the image tag for the microservice that was just built.

This MR changes the deploy helpers such that if AUTO_DEVOPS_CHART is set, it will always be used, even if there is a chart/ directory in the repo.

Additionally, when $CI_JOB_STAGE is review, after fetching and untarring AUTO_DEVOPS_CHART, its dependencies will be examined, and if the name of the chart in chart/ is among those dependencies:

  • chart/ will be copied to <untarred_AUTO_DEVOPS_CHART_location/charts/<dependency_name>
  • a "set image value prefix" will be saved, which is <dependency_name>.

Then, when deploying with helm upgrade, the image tag and repository override the dependency's (i.e. this repo's) image tag and repository with --set <dependency_name>.image.tag=... --set <dependency_name>.image.repository=....

If you guys think this is a reasonable approach, I will add this information to the docs, make/fix tests, etc.

Does this MR meet the acceptance criteria?

Conformity

Performance and testing

I do not believe there are any performance risks associated with this change.

Security

There are no security implications of this patch.

Merge request reports