gocd / docs.go.cd

GoCD user documentation
https://docs.gocd.org
Apache License 2.0
41 stars 137 forks source link

Add Documentation for Infrastructure as Code #538

Open rohte opened 3 years ago

rohte commented 3 years ago

Currently the only documentation about any kind of configuration uses the UI. I have not found any example where this was not the case.

Ideally I would wish for examples in terraform, but it would also be enough to know where the configuration is placed and what the format and schema of the file is. If this was treated a stable API, it would be even better.

maheshp commented 3 years ago

@rohte GoCD provides multiple ways to configure your pipelines, Pipeline as Code is one approach wherein you can define you pipeline configurations in an external repository. This functionality is provided through Configuration Repository plugins in GoCD.

All the Configuration Repository Plugins are listed here. You will have to refer the plugin documentation for specific configurations.

rohte commented 3 years ago

I believe you are misunderstanding my request. How to run Pipelines as Code is well enough documented, but I want to know how to deploy GoCD itself with Infrastructure as Code. So for example, how can I deploy GoCD to a server in a repeatable way with a couple of plugins configured and some pipeline repositories configured as well. In other words: How can GoDC deploy itself fully configured without any manual intervention? As far as I understand, the Pipeline as Code documentation is pretty much:

  1. Install this plugin
  2. open the UI
  3. configure the target repository with the pipeline in these fields
  4. done

I want to eliminate step 2 and 3 and replace it with terraform code (or Docker or Puppet or whatever infrastructure management tool you are using).

maheshp commented 3 years ago

Yeah, I got your request wrong :(

Since there is no one recommended way of setting up GoCD, I don't think there is any documentation around it. However users do share their experiences through blogs or discuss in forums. I do see a blog post around running GoCD on Kubernetes using Terraform if it helps.

rohte commented 3 years ago

Yes, I saw that post before. It does not help in our case as we already have it running and now want to configure other plugins.

So, after poking around a bit it looks like (almost?) all configuration is saved in the cruise-config.xml. A simple-ish (but probably with a lot of effort) thing that would help automation immensely is to add the format of that file to the documentation and whenever there an explanation on how to configure GoCD through the UI include how this can be achieved through changing the cruise-config.xml.

We have worked around the missing documentation like this:

  1. Follow instructions to configure in the UI (ideally in a local docker container)
  2. Find out how the cruise-config.xml has changed
  3. Put the changes in our deployment repository