flipt-io / cup

Git Contribution Automation
https://cup.flipt.io
Apache License 2.0
76 stars 1 forks source link

feat: implement cupd serve #21

Closed GeorgeMac closed 1 year ago

GeorgeMac commented 1 year ago

Fixes #9 Fixes #13

This implements cupd serve. It is just the start of wiring this all up together. I think there is a lot to be desired r.e. configuration parsing. But this is an MVP stab at it.

The following is an example cupd.json file to test-drive this with:

{
  "api": {
    "address": ":8181"
  },
  "sources": {
    "cup": {
      "type": "local",
      "local": {
        "path": "."
      },
      "resources": [
        {
          "controller": {
            "type": "template"
          },
          "inline": {
            "apiVersion": "cup.flipt.io/v1alpha1",
            "kind": "ResourceDefinition",
            "metadata": {
              "name": "flags.flipt.io"
            },
            "names": {
              "kind": "Flag",
              "singular": "flag",
              "plural": "flags"
            },
            "spec": {
              "group": "flipt.io",
              "versions": {
                "v1alpha1": {
                  "type": "object",
                  "properties": {
                    "enabled": { "type": "boolean" }
                  }
                }
              }
            }
          }
        }
      ]
    }
  }
}