Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change pipeline & pipeline template resources with native Terraform schema integration #38

Open
KeisukeYamashita opened this issue Jul 22, 2020 · 2 comments
Assignees

Comments

@KeisukeYamashita
Copy link
Contributor

WHAT

We want to declare pipelines by not JSON with HCL native way.

WHY

Better developer experience.
It is hard to find diffs when the pipeline is read by JSON.

@KeisukeYamashita KeisukeYamashita self-assigned this Jul 22, 2020
@KeisukeYamashita KeisukeYamashita changed the title Change pipeline resources with native Terraform schema integration Change pipeline & pipeline template resources with native Terraform schema integration Jul 22, 2020
@quinyx-tjeerd
Copy link

When I look at a pipeline diff it does show quite easily what the changes are, even though it's using json.

But I think the downside of the json approach is that it shows the entire json, meaning with larger json files / complex pipeline setups this can become problematic. However to solve that you'd need to split it into smaller parts but i don't think that's a better approach.

I would like to hear more about what the format would look like when using a more HCL approach and/or what the difficulties with finding the diffs were for you.

@KeisukeYamashita
Copy link
Contributor Author

KeisukeYamashita commented Oct 28, 2020

Thank you for reaching out. Nice to hear that JSON still works with good UX.

I would like to hear more about what the format would look like when using a more HCL approach and/or what the difficulties with finding the diffs were for you.

Sorry, my description was not exact. I have the same opinion to you.
Moreover, if we are able to migrate the schema with native HCL support, we can use the Terraform features (e.g. Lifecycle, Dynamic blocks, etc).

My (draft) plan is to map the JSON with HCL like below:

resource "spinnaker_pipeline"  "pipeline" {
     application = spinnaker_application.myapp.id
     name           = "wait-pipeline"
     
     stages {
          type  = "wait"
          wait_time = 3
     }

    stages {
          requiseteStageRefIds = 1
          type = "wait"
          wait_time   = 3
    }
}

If you have any opinion, please let me know 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants