mirror of
https://github.com/hashicorp/packer.git
synced 2026-05-28 04:35:38 -04:00
add DatasourceOutput type to struct-markdown cmd (#10512)
This commit is contained in:
parent
d1ada744e1
commit
7d0578c5b7
5 changed files with 14 additions and 3 deletions
|
|
@ -75,6 +75,11 @@ func main() {
|
|||
Filename: typeSpec.Name.Name + ".mdx",
|
||||
Header: strings.TrimSpace(typeDecl.Doc.Text()),
|
||||
}
|
||||
dataSourceOutput := Struct{
|
||||
SourcePath: sourcePath,
|
||||
Name: typeSpec.Name.Name,
|
||||
Filename: typeSpec.Name.Name + ".mdx",
|
||||
}
|
||||
required := Struct{
|
||||
SourcePath: sourcePath,
|
||||
Name: typeSpec.Name.Name,
|
||||
|
|
@ -145,6 +150,12 @@ func main() {
|
|||
Type: fieldType,
|
||||
Docs: docs,
|
||||
}
|
||||
|
||||
if typeSpec.Name.Name == "DatasourceOutput" {
|
||||
dataSourceOutput.Fields = append(dataSourceOutput.Fields, field)
|
||||
continue
|
||||
}
|
||||
|
||||
if req, err := tags.Get("required"); err == nil && req.Value() == "true" {
|
||||
required.Fields = append(required.Fields, field)
|
||||
} else {
|
||||
|
|
@ -155,7 +166,7 @@ func main() {
|
|||
dir := filepath.Join(projectRoot, "website", "content", "partials", builderName)
|
||||
os.MkdirAll(dir, 0755)
|
||||
|
||||
for _, str := range []Struct{header, required, notRequired} {
|
||||
for _, str := range []Struct{header, dataSourceOutput, required, notRequired} {
|
||||
if len(str.Fields) == 0 && len(str.Header) == 0 {
|
||||
continue
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,4 +38,4 @@ This selects the most recent Ubuntu 16.04 HVM EBS AMI from Canonical. Note that
|
|||
|
||||
## Output Data
|
||||
|
||||
@include 'datasource/amazon/ami/DatasourceOutput-not-required.mdx'
|
||||
@include 'datasource/amazon/ami/DatasourceOutput.mdx'
|
||||
|
|
|
|||
|
|
@ -48,4 +48,4 @@ with the [jsondecode() function](/docs/templates/hcl_templates/functions/encodin
|
|||
|
||||
## Output Data
|
||||
|
||||
@include 'datasource/amazon/secretsmanager/DatasourceOutput-not-required.mdx'
|
||||
@include 'datasource/amazon/secretsmanager/DatasourceOutput.mdx'
|
||||
|
|
|
|||
Loading…
Reference in a new issue