fabrikate icon indicating copy to clipboard operation
fabrikate copied to clipboard

Add ability to bundle tool hooks with Fabrikate components

Open timfpark opened this issue 6 years ago • 0 comments

As an operator, after utilizing a publicly available Fabrikate component like prometheus-grafana, I find myself writing scripts like this to be able to bring up easily the grafana dashboard:

`sleep 2 && open http://localhost:3000/d/4XuMd2Iiz/kubernetes-cluster-prometheus?orgId=1` &
  kubectl --namespace grafana port-forward $(kubectl get pods -n grafana -o jsonpath="{.items[0].metadata.name}") 3000

It would be great if these sorts of scripts could ride along with the component itself for convenience. Instead, as an operator, I want to be able to do something like this:

$ fab run grafana

where behind the scenes the author of a Fabrikate component has added a commands item to the component:

name: "prometheus-grafana"
generator: "static"
path: "./manifests"
subcomponents:
- name: "grafana"
  generator: "helm"
  repo: "https://github.com/helm/charts"
  path: "stable/grafana",
  commands:
    grafana:
    - sleep 1 && open http://localhost:3000/d/4XuMd2Iiz/kubernetes-cluster-prometheus?orgId=1 &
    - kubectl --namespace grafana port-forward $(kubectl get pods -n grafana -o jsonpath="{.items[0].metadata.name}") 3000
- name: "prometheus"
  generator: "helm"
  repo: "https://github.com/helm/charts"
  path: "stable/prometheus"

enabling Fabrikate to walk the component tree and find this grafana command and run each step one by one.

timfpark avatar Feb 21 '19 21:02 timfpark