hashicorp / packer

Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.
http://www.packer.io
Other
15.12k stars 3.33k forks source link

HCL docs for all plugins #9668

Open SwampDragons opened 4 years ago

SwampDragons commented 4 years ago

Docs cleanup: make sure that HCL examples are available for all plugins.

Provisioners

Postprocessors

Builders

adeniyistephen commented 3 years ago

@sylviamoss @SwampDragons @nywilken Hi, is the documentation for this issue completed? if not kindly provide input and pointers to work with, cause i think you people are busy. Thanks :)

sylviamoss commented 3 years ago

Hi @adeniyistephen, thanks for the interest in contributing. The documentation for this issue is not yet complete. I suggest you have a look at our previous PR to get how we add the HCL2 examples. Basically, in mdx files, we use Tab. On partials Tab doesn't work, when we generate the doc from a configuration we can't use it so we simply add as a new example under the JSON existing one. To get the HCL2 version from a JSON template you can use the hcl2_upgrade command. Let me know if you have any questions. Thanks again!

adeniyistephen commented 3 years ago

ok, thanks... lets say i want to generate the doc for openstark, how would the command look like, or where should i go to get the JSON? better still how do i just do one, Thanks... Please kindly get back.

SwampDragons commented 3 years ago

there's a json example in the docs page https://www.packer.io/docs/builders/openstack

adeniyistephen commented 3 years ago

ok, so what do i need to do there? and how do i get started? sorry my question can be too much. but i want to get it right. since there is a doc for openstark, should i pick another one ?

SwampDragons commented 3 years ago

The ticket is to add HCL formatted templates to the docs.

So, take the JSON template, convert it to HCL, and add the HCL to the markdown. The code for that website page is here: https://github.com/hashicorp/packer/blob/master/website/pages/docs/builders/openstack.mdx

You can find the source for pages that have already implemented HCL docs here: https://raw.githubusercontent.com/hashicorp/packer/master/website/pages/docs/builders/amazon/ebs.mdx

adeniyistephen commented 3 years ago

The ticket is to add HCL formatted templates to the docs.

So, take the JSON template, convert it to HCL, and add the HCL to the markdown. The code for that website page is here: https://github.com/hashicorp/packer/blob/master/website/pages/docs/builders/openstack.mdx

You can find the source for pages that have already implemented HCL docs here: https://raw.githubusercontent.com/hashicorp/packer/master/website/pages/docs/builders/amazon/ebs.mdx

Hi, I m sorry. The pages you shared are not found.

deric4 commented 3 years ago

@adeniyistephen I think the following change to the url should work:

- https://github.com/hashicorp/packer/blob/master/website/pages/docs/builders/openstack.mdx
+ https://github.com/hashicorp/packer/blob/master/website/content/docs/builders/openstack.mdx
- https://raw.githubusercontent.com/hashicorp/packer/master/website/pages/docs/builders/amazon/ebs.mdx
+ https://raw.githubusercontent.com/hashicorp/packer/master/website/content/docs/builders/amazon/ebs.mdx
adeniyistephen commented 3 years ago

@adeniyistephen I think the following change to the url should work:

- https://github.com/hashicorp/packer/blob/master/website/pages/docs/builders/openstack.mdx
+ https://github.com/hashicorp/packer/blob/master/website/content/docs/builders/openstack.mdx
- https://raw.githubusercontent.com/hashicorp/packer/master/website/pages/docs/builders/amazon/ebs.mdx
+ https://raw.githubusercontent.com/hashicorp/packer/master/website/content/docs/builders/amazon/ebs.mdx

Thanks. :)

tenthirtyam commented 5 months ago

Post split of the plugins, it seems that this should be dependent on the plugin's provider. Also, it seems that all the out-of-the-box provisioners have HCL docs now.

hashicorp/packer-plugin-scaffolding now leads with HCL.

cc @nywilken

Ryan