cityindex-attic / logsearch

[unmaintained] A development environment for ELK
Apache License 2.0
24 stars 8 forks source link

Add test:cloudformation_template_syntax task #332

Closed dpb587 closed 10 years ago

dpb587 commented 10 years ago

Requires a single argument which is parsed by glob to support directories and individual files. Exits with 1 if there's an error in one of the templates.

$ rake test:cloudformation_template_syntax[.build/aws/cloudformation/*.template]
> .build/aws/cloudformation/composite-ci-r53.template
+ json syntax is valid
X ERROR: cloudformation syntax is not valid
X A client error (ValidationError) occurred when calling the ValidateTemplate operation: Template format error: Unresolved resource dependencies [zEnvironmentName] in the Resources block of the template

> .build/aws/cloudformation/composite-example-standalone.template
+ json syntax is valid
+ cloudformation syntax is valid

> .build/aws/cloudformation/group-elasticsearch-default.template
+ json syntax is valid
+ cloudformation syntax is valid

> .build/aws/cloudformation/group-logstash-default.template
+ json syntax is valid
+ cloudformation syntax is valid

> .build/aws/cloudformation/node-es-ebs-default.template
+ json syntax is valid
+ cloudformation syntax is valid

> .build/aws/cloudformation/node-es-ephemeral-default.template
+ json syntax is valid
+ cloudformation syntax is valid

> .build/aws/cloudformation/node-kibana-default.template
+ json syntax is valid
+ cloudformation syntax is valid

> .build/aws/cloudformation/node-redis-default.template
+ json syntax is valid
+ cloudformation syntax is valid

> .build/aws/cloudformation/r53-ci-cname.template
+ json syntax is valid
+ cloudformation syntax is valid

> .build/aws/cloudformation/secgrp-single-default.template
+ json syntax is valid
+ cloudformation syntax is valid

$ echo $?
1
dpb587 commented 10 years ago

@sopel, care to review?

sopel commented 10 years ago

:+1: - great, that's very helpful indeed!