-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
Added support of readme generation #35
Changes from 2 commits
c937138
f1e1bc2
772c210
852cbc8
a03ede3
91d2bcb
d2216f7
a14309f
0b312b6
7dba942
9dc0d14
334f941
eb502c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
./terraform |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,51 @@ | ||
GOMPLATE_VERSION ?= v2.2.0 | ||
GOMPLATE_REPO ?= hairyhenderson/gomplate | ||
GOMPLATE ?= gomplate | ||
|
||
TEMPLATES ?= $(BUILD_HARNESS_PATH)/templates/docs | ||
|
||
.PHONY : docs\:toc-update | ||
## Update table of contents in README.md | ||
docs\:toc-update: | ||
@doctoc --notitle --github README.md | ||
@doctoc --notitle --github README.md | ||
|
||
## Install dependencies | ||
docs\:deps: | ||
@make github:download-public-release \ | ||
REPO=$(GOMPLATE_REPO) \ | ||
FILE=$(GOMPLATE)_$(OS)-amd64 \ | ||
VERSION=$(GOMPLATE_VERSION) \ | ||
OUTPUT=/usr/local/bin/$(GOMPLATE) > /dev/null | ||
@chmod +x /usr/local/bin/$(GOMPLATE) | ||
|
||
.PHONY : docs\:create | ||
## Create basic minimalistic .README.md template file | ||
docs\:create: | ||
@cp $(BUILD_HARNESS_PATH)/templates/README.md ./.README.md | ||
|
||
.PHONY : docs\:build | ||
## Create README.md by building it from .README.md file | ||
docs\:build: | ||
@NAME='$(NAME)' \ | ||
DESCRIPTION='$(DESCRIPTION)' \ | ||
$(GOMPLATE) \ | ||
--file ./.README.md \ | ||
--out ./README.md \ | ||
--datasource section=file://$(TEMPLATES)/sections.yml \ | ||
--datasource license=file://$(TEMPLATES)/licenses.yml \ | ||
--datasource contributor=file://$(TEMPLATES)/contributors.yml \ | ||
--datasource terraform=file://$(TEMPLATES)/terraform.yml | ||
|
||
.PHONY : docs\:make | ||
## Cleanup placeholders in README.md | ||
docs\:make: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't like the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
@make docs:build > /dev/null | ||
@NAME='$(NAME)' \ | ||
DESCRIPTION='$(DESCRIPTION)' \ | ||
$(GOMPLATE) \ | ||
--file ./README.md \ | ||
--out ./README.md \ | ||
--datasource section=file://$(TEMPLATES)/sections.yml \ | ||
--datasource license=file://$(TEMPLATES)/licenses.yml \ | ||
--datasource contributor=file://$(TEMPLATES)/contributors.yml \ | ||
--datasource terraform=file://$(TEMPLATES)/terraform.yml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
## {{ .Env.NAME }} | ||
{{ (datasource "section").warning }} | ||
{{ .Env.DESCRIPTION }} | ||
|
||
{{ (datasource "section").help }} | ||
{{ (datasource "section").contributing }} | ||
{{ (datasource "license").apache2 }} | ||
{{ (datasource "section").about }} | ||
|
||
### Contributors | ||
|
||
| | ||
{{- (datasource "contributor").erik }} | | ||
|---| | ||
|
||
{{ (datasource "contributor")._links }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
andrew: |- | ||
[![Andriy Knysh][andriy_img]][andriy_web]<br/>[Andriy Knysh][andriy_web] | ||
|
||
erik: |- | ||
[![Erik Osterman][erik_img]][erik_web]<br/>[Erik Osterman][erik_web] | ||
|
||
igor: |- | ||
[![Igor Rodionov][igor_img]][igor_web]<br/>[Igor Rodionov][igor_img] | ||
|
||
konstantin: |- | ||
[![Konstantin B][konstantin_img]][konstantin_web]<br/>[Konstantin B][konstantin_web] | ||
|
||
sergey: |- | ||
[![Sergey Vasilyev][sergey_img]][sergey_web]<br/>[Sergey Vasilyev][sergey_web] | ||
|
||
valeriy: |- | ||
[![Valeriy][valeriy_img]][valeriy_web]<br/>[Valeriy][valeriy_web] | ||
|
||
vladimir: |- | ||
[![Vladimir][vladimir_img]][vladimir_web]<br/>[Vladimir][vladimir_web] | ||
|
||
_links: |- | ||
[andriy_img]: https://avatars0.githubusercontent.com/u/7356997?v=4&u=ed9ce1c9151d552d985bdf5546772e14ef7ab617&s=144 | ||
[andriy_web]: https://github.com/aknysh/ | ||
|
||
[erik_img]: http://s.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb?s=144 | ||
[erik_web]: https://github.com/osterman/ | ||
|
||
[igor_img]: http://s.gravatar.com/avatar/bc70834d32ed4517568a1feb0b9be7e2?s=144 | ||
[igor_web]: https://github.com/goruha/ | ||
|
||
[konstantin_img]: https://avatars1.githubusercontent.com/u/11299538?v=4&u=ed9ce1c9151d552d985bdf5546772e14ef7ab617&s=144 | ||
[konstantin_web]: https://github.com/comeanother/ | ||
|
||
[sergey_img]: https://avatars1.githubusercontent.com/u/1134449?v=4&u=ed9ce1c9151d552d985bdf5546772e14ef7ab617&s=144 | ||
[sergey_web]: https://github.com/s2504s/ | ||
|
||
[valeriy_img]: https://avatars1.githubusercontent.com/u/10601658?v=4&u=ed9ce1c9151d552d985bdf5546772e14ef7ab617&s=144 | ||
[valeriy_web]: https://github.com/drama17/ | ||
|
||
[vladimir_img]: https://avatars1.githubusercontent.com/u/26582191?v=4&u=ed9ce1c9151d552d985bdf5546772e14ef7ab617&s=144 | ||
[vladimir_web]: https://github.com/SweetOps/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
apache2: |- | ||
## License | ||
|
||
[APACHE 2.0](LICENSE) © 2017 [Cloud Posse, LLC](https://cloudposse.com) | ||
|
||
See [LICENSE](LICENSE) for full details. | ||
|
||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
warning: |- | ||
<!--------------------------------DO NOT EDIT README.md--------------------------------> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
about: |- | ||
## About | ||
|
||
This module is maintained and funded by [Cloud Posse, LLC][website]. Like it? Please let us know at <[email protected]> | ||
|
||
We love [Open Source Software](https://github.com/cloudposse/)! | ||
|
||
See [our other projects][community] | ||
or [hire us][hire] to help build your next cloud-platform. | ||
|
||
[website]: http://cloudposse.com/ | ||
[community]: https://github.com/cloudposse/ | ||
[hire]: http://cloudposse.com/contact/ | ||
help: |- | ||
## Help | ||
|
||
**Got a question?** | ||
|
||
File a GitHub [issue](https://github.com/cloudposse/{{ .Env.NAME }}/issues), send us an [email](mailto:[email protected]) or reach out to us on [Gitter](https://gitter.im/cloudposse/). | ||
|
||
contributing: |- | ||
## Contributing | ||
|
||
### Bug Reports & Feature Requests | ||
|
||
Please use the [issue tracker](https://github.com/cloudposse/{{ .Env.NAME }}/issues) to report any bugs or file feature requests. | ||
|
||
### Developing | ||
|
||
If you are interested in being a contributor and want to get involved in developing `{{ .Env.NAME }}`, we would love to hear from you! Shoot us an [email](mailto:[email protected]). | ||
|
||
In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow. | ||
|
||
1. **Fork** the repo on GitHub | ||
2. **Clone** the project to your own machine | ||
3. **Commit** changes to your own branch | ||
4. **Push** your work back up to your fork | ||
5. Submit a **Pull request** so that we can review your changes | ||
|
||
**NOTE:** Be sure to merge the latest from "upstream" before making a pull request! |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
input: |- | ||
## Input | ||
|
||
<!--------------------------------REQUIRE POSTPROCESSING--------------------------------> | ||
| Name | Default | Description | | ||
|:------|:---------:|:--------------:| | ||
{{- range $index, $element := (datasource "terraform_data").Inputs }} | ||
| {{ $element.Name }} | | ||
{{- if $element.Default }} | ||
{{- if eq $element.Default.Type "map" }} | ||
{{- "{}" }} | ||
{{- else }} | ||
{{- if eq $element.Default.Type "list" -}} | ||
[] | ||
{{- else -}} | ||
"{{ $element.Default.Literal }}" | ||
{{- end }} | ||
{{- end }} | ||
{{- else -}} | ||
__REQUIRED__ | ||
{{- end }} | | ||
{{- $element.Description | strings.ReplaceAll "\n" " " }} | | ||
{{- end }} | ||
|
||
output: |- | ||
## Output | ||
|
||
<!--------------------------------REQUIRE POSTPROCESSING--------------------------------> | ||
| Name | Description | | ||
|:------|:------------:| | ||
{{- range $index, $element := (datasource "terraform_data").Outputs }} | ||
| {{ $element.Name }} | {{ $element.Description | strings.ReplaceAll "\n" " " }} | | ||
{{- end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be called
build-readme
since it's very specific to readme. Ordocs:
should be renamed toreadme:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done