cloudandthings / terraform-pretty-plan

Makes Terraform Plans Pretty
https://cloudandthings.github.io/terraform-pretty-plan/
MIT License
29 stars 4 forks source link

Integrating your tool in CD pipelines #10

Open cveld opened 1 year ago

cveld commented 1 year ago

On your blog https://medium.com/cloudandthings/pretty-print-better-terraform-plans-6a90b13b1d57 you make mention of your CD pipeline where you have integrated your pretty plan tool. Can you elaborate more how we could do the same? We are using GitHub workflow and Azure Pipelines.

phzietsman commented 1 year ago

Hey there,

We are using it with GoCD which allows you to create custom tabs on a pipeline stage. These custom tabs can render pipeline artifacts and static web pages. We inject a built version of this repo in as an artifact.

As part of our pipelines we generate a JSON plan and store it as plan.json in the root of the web project and serve it as a separate tab.

I doubt if the same approach will work in GH Actions.

cveld commented 1 year ago

Maybe on GitHub a GitHub page can be published per pipeline run?

Cool to get the pointer to GoCD! Thanks! So far mostly I came across GitHub / Azure DevOps / GitLab and Jenkins.

phzietsman commented 1 year ago

I think Jenkins can do something similar.

Here we are hosting it as a GH page: https://cloudandthings.github.io/terraform-pretty-plan/

EDIT: Here is the GoCD link to tabs: https://docs.gocd.org/current/faq/dev_see_artifact_as_tab.html

Just be aware the project seems to be in "maintenance mode". We have a TF provider to interact with GoCD if you are interested (https://registry.terraform.io/providers/cloudandthings/gocd/0.2.0-alpha).