Skip to content

Commit

Permalink
terraform/migrate-to-registry Makefile target added (#258)
Browse files Browse the repository at this point in the history
* terraform/migrate-to-registry Makefile target added

* target renamed

* readme rebuilded

* markdown linter rules fix to avoid raising errors for lines longer then 400 chars

* full linter config applied

* terraform format for examples as well

* markdownlint disabled for contributors table

* regex fix

* readme fix

* readme fix

* linter rules removed, no need for them any more
  • Loading branch information
maximmi authored Nov 25, 2020
1 parent 1a93d41 commit 22a3b75
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<!-- markdownlint-disable -->
# Build Harness [![Build Status](https://github.com/cloudposse/build-harness/workflows/docker/badge.svg?branch=master)](https://github.com/cloudposse/build-harness/actions?query=workflow%3Adocker) [![Latest Release](https://img.shields.io/github/release/cloudposse/build-harness.svg)](https://github.com/cloudposse/build-harness/releases/latest) [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com) [![Discourse Forum](https://img.shields.io/discourse/https/ask.sweetops.com/posts.svg)](https://ask.sweetops.com/)
<!-- markdownlint-restore -->

[![README Header][readme_header_img]][readme_header_link]

Expand Down Expand Up @@ -239,6 +241,7 @@ Available targets:
terraform/get-plugins Ensure all plugins can be fetched
terraform/install Install terraform
terraform/lint Lint check Terraform
terraform/rewrite-module-source Rewrite the *.tf files to use registry notation for modules sources
terraform/upgrade-modules Upgrade all terraform module sources
terraform/validate Basic terraform sanity check
travis/docker-login Login into docker hub
Expand Down Expand Up @@ -412,8 +415,10 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply

### Contributors

<!-- markdownlint-disable -->
| [![Erik Osterman][osterman_avatar]][osterman_homepage]<br/>[Erik Osterman][osterman_homepage] | [![Igor Rodionov][goruha_avatar]][goruha_homepage]<br/>[Igor Rodionov][goruha_homepage] | [![Andriy Knysh][aknysh_avatar]][aknysh_homepage]<br/>[Andriy Knysh][aknysh_homepage] | [![Sarkis][sarkis_avatar]][sarkis_homepage]<br/>[Sarkis][sarkis_homepage] | [![Alexander Babai][alebabai_avatar]][alebabai_homepage]<br/>[Alexander Babai][alebabai_homepage] | [![Jon Boulle][jonboulle_avatar]][jonboulle_homepage]<br/>[Jon Boulle][jonboulle_homepage] | [![Marcin Brański][3h4x_avatar]][3h4x_homepage]<br/>[Marcin Brański][3h4x_homepage] |
|---|---|---|---|---|---|---|
<!-- markdownlint-restore -->

[osterman_homepage]: https://github.com/osterman
[osterman_avatar]: https://img.cloudposse.com/150x150/https://github.com/osterman.png
Expand Down
1 change: 1 addition & 0 deletions docs/targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ Available targets:
terraform/get-plugins Ensure all plugins can be fetched
terraform/install Install terraform
terraform/lint Lint check Terraform
terraform/rewrite-module-source Rewrite the *.tf files to use registry notation for modules sources
terraform/upgrade-modules Upgrade all terraform module sources
terraform/validate Basic terraform sanity check
travis/docker-login Login into docker hub
Expand Down
6 changes: 6 additions & 0 deletions modules/terraform/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,9 @@ endif
## Upgrade all terraform module sources
terraform/upgrade-modules:
@$(BUILD_HARNESS_PATH)/bin/upgrade_terraform_modules.sh all

## Rewrite the *.tf files to use registry notation for modules sources
terraform/rewrite-module-source:
@sed -i -E 's,"git::https://github.com/(.*?)/terraform-([^-]*?)-(.*?).git\?ref=tags/(.*?)","\1/\3/\2"\n version = "\4",g' $$(find . -type f -name '*.tf')
@$(TERRAFORM) fmt .
@$(TERRAFORM) fmt examples/complete
4 changes: 4 additions & 0 deletions templates/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{{- defineDatasource "config" .Env.README_YAML | regexp.Replace ".*" "" -}}
{{- defineDatasource "includes" .Env.README_INCLUDES | regexp.Replace ".*" "" -}}
<!-- markdownlint-disable -->
# {{(ds "config").name}}{{ if gt (len (ds "config").name) 34 }}{{ print "\n\n" }}{{ end }}{{ if has (ds "config") "badges" }}{{- range $badge := (ds "config").badges -}}{{ printf " [![%s](%s)](%s)" $badge.name $badge.image $badge.url }}{{ end }}{{ end }}
<!-- markdownlint-restore -->

[![README Header][readme_header_img]][readme_header_link]

Expand Down Expand Up @@ -355,8 +357,10 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
{{ if has (datasource "config") "contributors" }}
### Contributors

<!-- markdownlint-disable -->
| {{ range $contributor := (ds "config").contributors }}{{ printf " [![%s][%s_avatar]][%s_homepage]<br/>[%s][%s_homepage] |" $contributor.name $contributor.github $contributor.github $contributor.name $contributor.github}}{{ end }}
|{{- range $contributor := (ds "config").contributors -}}---|{{ end }}
<!-- markdownlint-restore -->

{{ range $contributor := (ds "config").contributors -}}
{{- if has $contributor "homepage" }}
Expand Down

0 comments on commit 22a3b75

Please sign in to comment.