Reputation: 1255
I have a Source of Truth database with an api layer over it, that keeps track of, for instance, Subnets, Hosts, DNS, Host Allocations, etc. What I'd like to do is set up an infrastructure as code pipeline, where changes to yaml files in a git repo would call the correct APIs.
For instance, this diff would call the subnet.post api:
+ subnet:
+ cidr: 10.0.0.0/8
+ name: Really big CIDR
And this diff would call the subnet.delete api:
- subnet:
- cidr: 10.0.0.0/8
- name: Really big CIDR
I'm thinking:
Upvotes: 1
Views: 43
Reputation: 1334
I don't think my answer can cover your entire use case but anyway here it is:
For triggering Jenkins when a push to a repository happened I recommend Generic Webhook Trigger Plugin. It helps you a lot with parsing the information Github/Bitbucket/Gitlab gives you when they trigger your pipeline.
For the query, you could simply use sh curl ...
or have a look at the HTTP Requests Plugin
Looking for changes in the YAML could be done by hand or you could use the changelog Jenkins provides in the pipeline.
Upvotes: 1