diff --git a/README.md b/README.md index be7565cb..c0de0a5d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ + # 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/) + [![README Header][readme_header_img]][readme_header_link] @@ -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 @@ -412,8 +415,10 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply ### Contributors + | [![Erik Osterman][osterman_avatar]][osterman_homepage]
[Erik Osterman][osterman_homepage] | [![Igor Rodionov][goruha_avatar]][goruha_homepage]
[Igor Rodionov][goruha_homepage] | [![Andriy Knysh][aknysh_avatar]][aknysh_homepage]
[Andriy Knysh][aknysh_homepage] | [![Sarkis][sarkis_avatar]][sarkis_homepage]
[Sarkis][sarkis_homepage] | [![Alexander Babai][alebabai_avatar]][alebabai_homepage]
[Alexander Babai][alebabai_homepage] | [![Jon Boulle][jonboulle_avatar]][jonboulle_homepage]
[Jon Boulle][jonboulle_homepage] | [![Marcin Brański][3h4x_avatar]][3h4x_homepage]
[Marcin Brański][3h4x_homepage] | |---|---|---|---|---|---|---| + [osterman_homepage]: https://github.com/osterman [osterman_avatar]: https://img.cloudposse.com/150x150/https://github.com/osterman.png diff --git a/docs/targets.md b/docs/targets.md index a7f0b527..b48fd6af 100644 --- a/docs/targets.md +++ b/docs/targets.md @@ -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 diff --git a/modules/terraform/Makefile b/modules/terraform/Makefile index 1a48a4f5..c84b4b7a 100644 --- a/modules/terraform/Makefile +++ b/modules/terraform/Makefile @@ -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 diff --git a/templates/README.md.gotmpl b/templates/README.md.gotmpl index e70fef96..dd7a78cd 100644 --- a/templates/README.md.gotmpl +++ b/templates/README.md.gotmpl @@ -1,6 +1,8 @@ {{- defineDatasource "config" .Env.README_YAML | regexp.Replace ".*" "" -}} {{- defineDatasource "includes" .Env.README_INCLUDES | regexp.Replace ".*" "" -}} + # {{(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 }} + [![README Header][readme_header_img]][readme_header_link] @@ -355,8 +357,10 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply {{ if has (datasource "config") "contributors" }} ### Contributors + | {{ range $contributor := (ds "config").contributors }}{{ printf " [![%s][%s_avatar]][%s_homepage]
[%s][%s_homepage] |" $contributor.name $contributor.github $contributor.github $contributor.name $contributor.github}}{{ end }} |{{- range $contributor := (ds "config").contributors -}}---|{{ end }} + {{ range $contributor := (ds "config").contributors -}} {{- if has $contributor "homepage" }}