From 26071768304e9a4201024af37cd5d1d4de7307e9 Mon Sep 17 00:00:00 2001 From: Maxim Mironenko Date: Tue, 17 Nov 2020 18:11:36 +0600 Subject: [PATCH 01/11] terraform/migrate-to-registry Makefile target added --- modules/terraform/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/terraform/Makefile b/modules/terraform/Makefile index 1a48a4f5..7814ab3e 100644 --- a/modules/terraform/Makefile +++ b/modules/terraform/Makefile @@ -43,3 +43,8 @@ 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/migrate-to-registry: + @sed -i -E 's,"git::https://github.com/(.*?).git\?ref=tags/(.*?)","\1"\n version = "\2",g' $$(find . -type f -name '*.tf') + @$(TERRAFORM) fmt . \ No newline at end of file From 6f9240bdae9a3eec1413dda32cf6403282f0536a Mon Sep 17 00:00:00 2001 From: Maxim Mironenko Date: Tue, 17 Nov 2020 18:14:54 +0600 Subject: [PATCH 02/11] target renamed --- modules/terraform/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/terraform/Makefile b/modules/terraform/Makefile index 7814ab3e..0bad961c 100644 --- a/modules/terraform/Makefile +++ b/modules/terraform/Makefile @@ -45,6 +45,6 @@ terraform/upgrade-modules: @$(BUILD_HARNESS_PATH)/bin/upgrade_terraform_modules.sh all ## Rewrite the *.tf files to use registry notation for modules sources -terraform/migrate-to-registry: +terraform/rewrite-module-source: @sed -i -E 's,"git::https://github.com/(.*?).git\?ref=tags/(.*?)","\1"\n version = "\2",g' $$(find . -type f -name '*.tf') @$(TERRAFORM) fmt . \ No newline at end of file From a2cb00ed190919997f3fb6bb6e3cd03fb5af07cf Mon Sep 17 00:00:00 2001 From: Maxim Mironenko Date: Tue, 17 Nov 2020 18:20:46 +0600 Subject: [PATCH 03/11] readme rebuilded --- README.md | 1 + docs/targets.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index be7565cb..d9e30cc1 100644 --- a/README.md +++ b/README.md @@ -239,6 +239,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/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 From af0de25be402de8fd3f085c7e4898be97a0c1762 Mon Sep 17 00:00:00 2001 From: Maxim Mironenko Date: Tue, 17 Nov 2020 18:45:39 +0600 Subject: [PATCH 04/11] markdown linter rules fix to avoid raising errors for lines longer then 400 chars --- .github/linters/.markdown-lint.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .github/linters/.markdown-lint.yml diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml new file mode 100644 index 00000000..7033bb42 --- /dev/null +++ b/.github/linters/.markdown-lint.yml @@ -0,0 +1,2 @@ +MD013: + line_length: 800 # Line length 400 is too short \ No newline at end of file From 8fd413258cab2f97ecfb00d7de977daecdf58bc7 Mon Sep 17 00:00:00 2001 From: Maxim Mironenko Date: Tue, 17 Nov 2020 19:05:53 +0600 Subject: [PATCH 05/11] full linter config applied --- .github/linters/.markdown-lint.yml | 35 +++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml index 7033bb42..c351087c 100644 --- a/.github/linters/.markdown-lint.yml +++ b/.github/linters/.markdown-lint.yml @@ -1,2 +1,35 @@ +--- +########################### +########################### +## Markdown Linter rules ## +########################### +########################### + +# Linter rules doc: +# - https://github.com/DavidAnson/markdownlint +# +# Note: +# To comment out a single error: +# +# any violations you want +# +# + +############### +# Rules by id # +############### +MD004: false # Unordered list style +MD007: + indent: 2 # Unordered list indentation MD013: - line_length: 800 # Line length 400 is too short \ No newline at end of file + line_length: 800 # Line length 80 is far to short +MD026: + punctuation: ".,;:!。,;:" # List of not allowed +MD029: false # Ordered list item prefix +MD033: false # Allow inline HTML +MD036: false # Emphasis used instead of a heading + +################# +# Rules by tags # +################# +blank_lines: false # Error on blank lines \ No newline at end of file From 8d9cd2d73f55379dffca59e70d35876a5fae67bf Mon Sep 17 00:00:00 2001 From: Maxim Mironenko Date: Wed, 18 Nov 2020 00:18:13 +0600 Subject: [PATCH 06/11] terraform format for examples as well --- modules/terraform/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/terraform/Makefile b/modules/terraform/Makefile index 0bad961c..42667425 100644 --- a/modules/terraform/Makefile +++ b/modules/terraform/Makefile @@ -47,4 +47,5 @@ terraform/upgrade-modules: ## Rewrite the *.tf files to use registry notation for modules sources terraform/rewrite-module-source: @sed -i -E 's,"git::https://github.com/(.*?).git\?ref=tags/(.*?)","\1"\n version = "\2",g' $$(find . -type f -name '*.tf') - @$(TERRAFORM) fmt . \ No newline at end of file + @$(TERRAFORM) fmt . + @$(TERRAFORM) fmt examples/complete From fc4696a28dca8cd507b525db059be39d0f284379 Mon Sep 17 00:00:00 2001 From: Maxim Mironenko Date: Wed, 18 Nov 2020 00:49:31 +0600 Subject: [PATCH 07/11] markdownlint disabled for contributors table --- .github/linters/.markdown-lint.yml | 2 +- templates/README.md.gotmpl | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml index c351087c..079d5c00 100644 --- a/.github/linters/.markdown-lint.yml +++ b/.github/linters/.markdown-lint.yml @@ -22,7 +22,7 @@ MD004: false # Unordered list style MD007: indent: 2 # Unordered list indentation MD013: - line_length: 800 # Line length 80 is far to short + line_length: 400 # Line length 80 is far to short MD026: punctuation: ".,;:!。,;:" # List of not allowed MD029: false # Ordered list item prefix diff --git a/templates/README.md.gotmpl b/templates/README.md.gotmpl index e70fef96..c2cc973d 100644 --- a/templates/README.md.gotmpl +++ b/templates/README.md.gotmpl @@ -355,8 +355,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" }} From a2f0d2c21bd0b9cb13898c9807f5de8e4cf02c1e Mon Sep 17 00:00:00 2001 From: Maxim Mironenko Date: Wed, 25 Nov 2020 21:36:06 +0600 Subject: [PATCH 08/11] regex fix --- modules/terraform/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/terraform/Makefile b/modules/terraform/Makefile index 42667425..c84b4b7a 100644 --- a/modules/terraform/Makefile +++ b/modules/terraform/Makefile @@ -46,6 +46,6 @@ terraform/upgrade-modules: ## Rewrite the *.tf files to use registry notation for modules sources terraform/rewrite-module-source: - @sed -i -E 's,"git::https://github.com/(.*?).git\?ref=tags/(.*?)","\1"\n version = "\2",g' $$(find . -type f -name '*.tf') + @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 From 0d48112658dfcb215596928e8ab0dd78bd0f16b2 Mon Sep 17 00:00:00 2001 From: Maxim Mironenko Date: Wed, 25 Nov 2020 21:46:40 +0600 Subject: [PATCH 09/11] readme fix --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d9e30cc1..e0747f4b 100644 --- a/README.md +++ b/README.md @@ -413,8 +413,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 From d2a9245be92d8c61f2529a7d81e8a9a51c0c3618 Mon Sep 17 00:00:00 2001 From: Maxim Mironenko Date: Wed, 25 Nov 2020 22:04:06 +0600 Subject: [PATCH 10/11] readme fix --- README.md | 2 ++ templates/README.md.gotmpl | 2 ++ 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index e0747f4b..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] diff --git a/templates/README.md.gotmpl b/templates/README.md.gotmpl index c2cc973d..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] From 07ddb05db15aa989794cfb9fb9ed9762955b573f Mon Sep 17 00:00:00 2001 From: Maxim Mironenko Date: Wed, 25 Nov 2020 22:56:11 +0600 Subject: [PATCH 11/11] linter rules removed, no need for them any more --- .github/linters/.markdown-lint.yml | 35 ------------------------------ 1 file changed, 35 deletions(-) delete mode 100644 .github/linters/.markdown-lint.yml diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml deleted file mode 100644 index 079d5c00..00000000 --- a/.github/linters/.markdown-lint.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -########################### -########################### -## Markdown Linter rules ## -########################### -########################### - -# Linter rules doc: -# - https://github.com/DavidAnson/markdownlint -# -# Note: -# To comment out a single error: -# -# any violations you want -# -# - -############### -# Rules by id # -############### -MD004: false # Unordered list style -MD007: - indent: 2 # Unordered list indentation -MD013: - line_length: 400 # Line length 80 is far to short -MD026: - punctuation: ".,;:!。,;:" # List of not allowed -MD029: false # Ordered list item prefix -MD033: false # Allow inline HTML -MD036: false # Emphasis used instead of a heading - -################# -# Rules by tags # -################# -blank_lines: false # Error on blank lines \ No newline at end of file