Skip to content

Flatten Auto DevOps into single `.gitlab-ci.yml`

Description

Auto deploy is awesome, but because all of the logic is buried in a Docker image, it is:

  • hard for developers to understand, trust, and modify,
  • and outside of project version control.

Hypothesis: If we flatten the bash scripts in kubernetes-deploy, and put all of the content in a .gitlab-ci.yml template, we would be showing people exactly what we're doing, as well as letting them modify it as needed, or keep it stable and impervious to changes outside their control.

Known downsides:

  • The flattened .gitlab-ci.yml is 150 lines and hard to read.
  • The flattened .gitlab-ci.yml is Kubernetes specific, whereas a simple .gitlab-ci.yml could switch providers by just referencing a different image that implements the same "interface".

Note: Part of downsides may be relieved by adding an include capability to .gitlab-ci.yml so the complex Kubernetes-specific portions could be put into a subfile that is included in the master file. At that point, it is remarkably similar to the current bash script approach. The included configuration could be injected into the repo, or referenced externally, but either choice is viable for bash scripts too.

Proposal

  1. Move Kubernetes configuration to helm chart (https://gitlab.com/charts/charts.gitlab.io/tree/master/charts/auto-deploy-app)
  2. Move bash scripts into monolithic .gitlab-ci.yml template (gitlab-ci-yml!62 (closed))
  3. Simplify script as much as possible
  4. Simplify Docker image to just a Dockerfile to install kubectl, helm, etc. (TBD)

Examples

Links / references

Edited by Mark Pundsack