Skip to content

Manage doco-cd configuration changes/image updates using doco-cd itself #827

@AlessandroZanatta

Description

@AlessandroZanatta

Description

It's a common pattern with GitOps and CD to also manage the tool that does the CD... with the tool itself.

For example, it's common practice to manage ArgoCD with ArgoCD itself, after a first stage of bootstrapping.
This feature would allow for a more intuitive and dev-friendly way of managing doco-cd. After all, it is a container, hence it should also be managed the same way other containers are!

Use Case

I would like to ensure that every configuration change to doco-cd, as well as any update to the image tag, are versioned and controlled like any other deployed stack.

Additional Information

I have attempted to force this behavior onto doco-cd, but it does not appear to be possible at the moment.

In order to attempt this, I added the following to .doco-cd.yaml:

---
name: doco-cd
working_dir: services/doco-cd

and also gave the following labels to the doco-cd container itself:

    labels:
      cd.doco.metadata.manager: doco-cd
      cd.doco.repository.name: CapgeminiCisRedTeam/tools

These labels allow to bypass this check and trick doco-cd into (attempting to) manage itself.

However, the end result was that doco-cd was just erasing its container without recreating it. I haven't had the time to dig deeper in the code, but I assume it's due to how containers are handled (first destroyed and then recreated? Or maybe the doco-cd process is killed and the container never comes back since the code that should recreate it never runs, not sure).

Moreover, this approach could easily break due to an update on doco-cd internals.

I would gladly try to contribute to this in my free time, though I'm admittedly not very knowledgeable in Go.
Moreover, I've only skimmed the code base (and found a remarkably long function 👀), but I can give this a try if given some pointers (if this feature would be a good addition, which I'm very confident about)!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions