From 05ef0a3537d4a0a9f5292a52f2b03d151199c345 Mon Sep 17 00:00:00 2001 From: Bryant Biggs Date: Tue, 26 Oct 2021 12:00:00 -0400 Subject: [PATCH 01/11] fix: update CI/CD process to use composite actions and auto-release workflow --- .chglog/CHANGELOG.tpl.md | 111 ------------------ .chglog/config.yml | 10 -- .github/workflows/pre-commit.yml | 103 +++++++--------- .github/workflows/release.yml | 29 +++++ .pre-commit-config.yaml | 6 +- .releaserc.json | 27 +++++ CHANGELOG.md | 9 -- Makefile | 7 -- README.md | 8 +- examples/complete-mssql/README.md | 4 +- examples/complete-mysql/README.md | 6 +- examples/complete-oracle/README.md | 4 +- examples/complete-postgres/README.md | 6 +- .../cross-region-replica-postgres/README.md | 4 +- examples/enhanced-monitoring/README.md | 2 +- examples/groups/README.md | 10 +- examples/replica-mysql/README.md | 4 +- examples/replica-postgres/README.md | 4 +- examples/s3-import-mysql/README.md | 2 +- modules/db_option_group/main.tf | 1 - modules/db_option_group/outputs.tf | 1 - modules/db_parameter_group/main.tf | 1 - modules/db_subnet_group/outputs.tf | 1 - modules/db_subnet_group/variables.tf | 1 - 24 files changed, 129 insertions(+), 232 deletions(-) delete mode 100644 .chglog/CHANGELOG.tpl.md delete mode 100644 .chglog/config.yml create mode 100644 .github/workflows/release.yml create mode 100644 .releaserc.json delete mode 100644 Makefile diff --git a/.chglog/CHANGELOG.tpl.md b/.chglog/CHANGELOG.tpl.md deleted file mode 100644 index 687d7023..00000000 --- a/.chglog/CHANGELOG.tpl.md +++ /dev/null @@ -1,111 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. - -{{ if .Versions -}} - -## [Unreleased] -{{ if .Unreleased.CommitGroups -}} -{{ range .Unreleased.CommitGroups -}} -### {{ .Title }} -{{ range .Commits -}} -{{/* SKIPPING RULES - START */ -}} -{{- if not (hasPrefix .Subject "Updated CHANGELOG") -}} -{{- if not (contains .Subject "[ci skip]") -}} -{{- if not (contains .Subject "[skip ci]") -}} -{{- if not (hasPrefix .Subject "Merge pull request ") -}} -{{- if not (hasPrefix .Subject "Added CHANGELOG") -}} -{{- /* SKIPPING RULES - END */ -}} -- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} -{{/* SKIPPING RULES - START */ -}} -{{ end -}} -{{ end -}} -{{ end -}} -{{ end -}} -{{ end -}} -{{/* SKIPPING RULES - END */ -}} -{{ end }} -{{ end -}} -{{ else }} -{{ range .Unreleased.Commits -}} -{{/* SKIPPING RULES - START */ -}} -{{- if not (hasPrefix .Subject "Updated CHANGELOG") -}} -{{- if not (contains .Subject "[ci skip]") -}} -{{- if not (contains .Subject "[skip ci]") -}} -{{- if not (hasPrefix .Subject "Merge pull request ") -}} -{{- if not (hasPrefix .Subject "Added CHANGELOG") -}} -{{- /* SKIPPING RULES - END */ -}} -- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} -{{/* SKIPPING RULES - START */ -}} -{{ end -}} -{{ end -}} -{{ end -}} -{{ end -}} -{{ end -}} -{{/* SKIPPING RULES - END */ -}} -{{ end }} -{{ end -}} -{{ end -}} - -{{ range .Versions }} - -## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }} -{{ if .CommitGroups -}} -{{ range .CommitGroups -}} -### {{ .Title }} -{{ range .Commits -}} -{{/* SKIPPING RULES - START */ -}} -{{- if not (hasPrefix .Subject "Updated CHANGELOG") -}} -{{- if not (contains .Subject "[ci skip]") -}} -{{- if not (contains .Subject "[skip ci]") -}} -{{- if not (hasPrefix .Subject "Merge pull request ") -}} -{{- if not (hasPrefix .Subject "Added CHANGELOG") -}} -{{- /* SKIPPING RULES - END */ -}} -- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} -{{/* SKIPPING RULES - START */ -}} -{{ end -}} -{{ end -}} -{{ end -}} -{{ end -}} -{{ end -}} -{{/* SKIPPING RULES - END */ -}} -{{ end }} -{{ end -}} -{{ else }} -{{ range .Commits -}} -{{/* SKIPPING RULES - START */ -}} -{{- if not (hasPrefix .Subject "Updated CHANGELOG") -}} -{{- if not (contains .Subject "[ci skip]") -}} -{{- if not (contains .Subject "[skip ci]") -}} -{{- if not (hasPrefix .Subject "Merge pull request ") -}} -{{- if not (hasPrefix .Subject "Added CHANGELOG") -}} -{{- /* SKIPPING RULES - END */ -}} -- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} -{{/* SKIPPING RULES - START */ -}} -{{ end -}} -{{ end -}} -{{ end -}} -{{ end -}} -{{ end -}} -{{/* SKIPPING RULES - END */ -}} -{{ end }} -{{ end -}} - -{{- if .NoteGroups -}} -{{ range .NoteGroups -}} -### {{ .Title }} -{{ range .Notes }} -{{ .Body }} -{{ end }} -{{ end -}} -{{ end -}} -{{ end -}} - -{{- if .Versions }} -[Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD -{{ range .Versions -}} -{{ if .Tag.Previous -}} -[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }} -{{ end -}} -{{ end -}} -{{ end -}} diff --git a/.chglog/config.yml b/.chglog/config.yml deleted file mode 100644 index eb13e2e6..00000000 --- a/.chglog/config.yml +++ /dev/null @@ -1,10 +0,0 @@ -style: github -template: CHANGELOG.tpl.md -info: - title: CHANGELOG - repository_url: https://github.com/terraform-aws-modules/terraform-aws-rds -options: - header: - pattern: "^(.*)$" - pattern_maps: - - Subject diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index ab9aef23..b8f1b8a5 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -2,98 +2,77 @@ name: Pre-Commit on: pull_request: - push: branches: + - main - master +env: + TERRAFORM_DOCS_VERSION: v0.16.0 + jobs: - # Min Terraform version(s) - getDirectories: - name: Get root directories + collectInputs: + name: Collect workflow inputs runs-on: ubuntu-latest + outputs: + directories: ${{ steps.dirs.outputs.directories }} steps: - name: Checkout uses: actions/checkout@v2 - - name: Install Python - uses: actions/setup-python@v2 - - name: Build matrix - id: matrix - run: | - DIRS=$(python -c "import json; import glob; print(json.dumps([x.replace('/versions.tf', '') for x in glob.glob('./**/versions.tf', recursive=True)]))") - echo "::set-output name=directories::$DIRS" - outputs: - directories: ${{ steps.matrix.outputs.directories }} + + - name: Get root directories + id: dirs + uses: clowdhaus/terraform-composite-actions/directories@v1.3.0 preCommitMinVersions: - name: Min TF validate - needs: getDirectories + name: Min TF pre-commit + needs: collectInputs runs-on: ubuntu-latest strategy: matrix: - directory: ${{ fromJson(needs.getDirectories.outputs.directories) }} + directory: ${{ fromJson(needs.collectInputs.outputs.directories) }} steps: - name: Checkout uses: actions/checkout@v2 - - name: Install Python - uses: actions/setup-python@v2 + - name: Terraform min/max versions id: minMax - uses: clowdhaus/terraform-min-max@v1.0.2 + uses: clowdhaus/terraform-min-max@v1.0.3 with: directory: ${{ matrix.directory }} - - name: Install Terraform v${{ steps.minMax.outputs.minVersion }} - uses: hashicorp/setup-terraform@v1 - with: - terraform_version: ${{ steps.minMax.outputs.minVersion }} - - name: Install pre-commit dependencies - run: pip install pre-commit - - name: Execute pre-commit + + - name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }} # Run only validate pre-commit check on min version supported if: ${{ matrix.directory != '.' }} - run: pre-commit run terraform_validate --color=always --show-diff-on-failure --files ${{ matrix.directory }}/* - - name: Execute pre-commit + uses: clowdhaus/terraform-composite-actions/pre-commit@v1.3.0 + with: + terraform-version: ${{ steps.minMax.outputs.minVersion }} + args: 'terraform_validate --color=always --show-diff-on-failure --files ${{ matrix.directory }}/*' + + - name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }} # Run only validate pre-commit check on min version supported if: ${{ matrix.directory == '.' }} - run: pre-commit run terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf) + uses: clowdhaus/terraform-composite-actions/pre-commit@v1.3.0 + with: + terraform-version: ${{ steps.minMax.outputs.minVersion }} + args: 'terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)' - # Max Terraform version - getBaseVersion: - name: Module max TF version + preCommitMaxVersion: + name: Max TF pre-commit runs-on: ubuntu-latest + needs: collectInputs steps: - name: Checkout uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{github.event.pull_request.head.repo.full_name}} + - name: Terraform min/max versions id: minMax - uses: clowdhaus/terraform-min-max@v1.0.2 - outputs: - minVersion: ${{ steps.minMax.outputs.minVersion }} - maxVersion: ${{ steps.minMax.outputs.maxVersion }} + uses: clowdhaus/terraform-min-max@v1.0.3 - preCommitMaxVersion: - name: Max TF pre-commit - runs-on: ubuntu-latest - needs: getBaseVersion - strategy: - fail-fast: false - matrix: - version: - - ${{ needs.getBaseVersion.outputs.maxVersion }} - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Install Python - uses: actions/setup-python@v2 - - name: Install Terraform v${{ matrix.version }} - uses: hashicorp/setup-terraform@v1 + - name: Pre-commit Terraform ${{ steps.minMax.outputs.maxVersion }} + uses: clowdhaus/terraform-composite-actions/pre-commit@v1.3.0 with: - terraform_version: ${{ matrix.version }} - - name: Install pre-commit dependencies - run: | - pip install pre-commit - curl -Lo ./terraform-docs.tar.gz https://github.com/terraform-docs/terraform-docs/releases/download/v0.13.0/terraform-docs-v0.13.0-$(uname)-amd64.tar.gz && tar -xzf terraform-docs.tar.gz && chmod +x terraform-docs && sudo mv terraform-docs /usr/bin/ - curl -L "$(curl -s https://api.github.com/repos/terraform-linters/tflint/releases/latest | grep -o -E "https://.+?_linux_amd64.zip")" > tflint.zip && unzip tflint.zip && rm tflint.zip && sudo mv tflint /usr/bin/ - - name: Execute pre-commit - # Run all pre-commit checks on max version supported - if: ${{ matrix.version == needs.getBaseVersion.outputs.maxVersion }} - run: pre-commit run --color=always --show-diff-on-failure --all-files + terraform-version: ${{ steps.minMax.outputs.maxVersion }} + terraform-docs-version: ${{ env.TERRAFORM_DOCS_VERSION }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..4bb4b71e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: Release + +on: + push: + branches: + - main + - master + paths: + - '*.tf' + - 'modules/**/*.tf' + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Release + uses: cycjimmy/semantic-release-action@v2 + with: + extra_plugins: | + @semantic-release/changelog@6.0.0 + @semantic-release/git@10.0.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index daf979f4..36405d17 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,10 +1,12 @@ repos: - repo: git://github.com/antonbabenko/pre-commit-terraform - rev: v1.50.0 + rev: v1.53.0 hooks: - id: terraform_fmt - id: terraform_validate - id: terraform_docs + args: + - '--args=--lockfile=false' - id: terraform_tflint args: - '--args=--only=terraform_deprecated_interpolation' @@ -24,3 +26,5 @@ repos: rev: v4.0.1 hooks: - id: check-merge-conflict + - id: trailing-whitespace + - id: end-of-file-fixer diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 00000000..a8889815 --- /dev/null +++ b/.releaserc.json @@ -0,0 +1,27 @@ +{ + "branches": [ + "main" + ], + "ci": false, + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "@semantic-release/github", + [ + "@semantic-release/changelog", + { + "changelogFile": "CHANGELOG.md", + "changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file. See\n[Conventional Commits](https://conventionalcommits.org) for commit guidelines." + } + ], + [ + "@semantic-release/git", + { + "assets": [ + "CHANGELOG.md" + ], + "message": "chore(release): version ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" + } + ] + ] +} diff --git a/CHANGELOG.md b/CHANGELOG.md index b11171a8..7048cd7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,3 @@ -# Change Log - -All notable changes to this project will be documented in this file. - - -## [Unreleased] - - - ## [v3.4.0] - 2021-09-07 diff --git a/Makefile b/Makefile deleted file mode 100644 index 558dac5a..00000000 --- a/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -.PHONY: changelog release - -changelog: - git-chglog -o CHANGELOG.md --next-tag `semtag final -s minor -o` - -release: - semtag final -s minor diff --git a/README.md b/README.md index 4144e3e0..7e95ac0e 100644 --- a/README.md +++ b/README.md @@ -220,10 +220,10 @@ Users have the ability to: | Name | Source | Version | |------|--------|---------| -| [db\_instance](#module\_db\_instance) | ./modules/db_instance | | -| [db\_option\_group](#module\_db\_option\_group) | ./modules/db_option_group | | -| [db\_parameter\_group](#module\_db\_parameter\_group) | ./modules/db_parameter_group | | -| [db\_subnet\_group](#module\_db\_subnet\_group) | ./modules/db_subnet_group | | +| [db\_instance](#module\_db\_instance) | ./modules/db_instance | n/a | +| [db\_option\_group](#module\_db\_option\_group) | ./modules/db_option_group | n/a | +| [db\_parameter\_group](#module\_db\_parameter\_group) | ./modules/db_parameter_group | n/a | +| [db\_subnet\_group](#module\_db\_subnet\_group) | ./modules/db_subnet_group | n/a | ## Resources diff --git a/examples/complete-mssql/README.md b/examples/complete-mssql/README.md index dcf46a8e..b39ab3f1 100644 --- a/examples/complete-mssql/README.md +++ b/examples/complete-mssql/README.md @@ -32,8 +32,8 @@ Note that this example may create resources which cost money. Run `terraform des | Name | Source | Version | |------|--------|---------| -| [db](#module\_db) | ../../ | | -| [db\_disabled](#module\_db\_disabled) | ../../ | | +| [db](#module\_db) | ../../ | n/a | +| [db\_disabled](#module\_db\_disabled) | ../../ | n/a | | [security\_group](#module\_security\_group) | terraform-aws-modules/security-group/aws | ~> 4 | | [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 2 | diff --git a/examples/complete-mysql/README.md b/examples/complete-mysql/README.md index 4e849245..aa31a35b 100644 --- a/examples/complete-mysql/README.md +++ b/examples/complete-mysql/README.md @@ -30,9 +30,9 @@ No providers. | Name | Source | Version | |------|--------|---------| -| [db](#module\_db) | ../../ | | -| [db\_default](#module\_db\_default) | ../../ | | -| [db\_disabled](#module\_db\_disabled) | ../../ | | +| [db](#module\_db) | ../../ | n/a | +| [db\_default](#module\_db\_default) | ../../ | n/a | +| [db\_disabled](#module\_db\_disabled) | ../../ | n/a | | [security\_group](#module\_security\_group) | terraform-aws-modules/security-group/aws | ~> 4 | | [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 2 | diff --git a/examples/complete-oracle/README.md b/examples/complete-oracle/README.md index 263958ea..3e842a2a 100644 --- a/examples/complete-oracle/README.md +++ b/examples/complete-oracle/README.md @@ -30,8 +30,8 @@ No providers. | Name | Source | Version | |------|--------|---------| -| [db](#module\_db) | ../../ | | -| [db\_disabled](#module\_db\_disabled) | ../../ | | +| [db](#module\_db) | ../../ | n/a | +| [db\_disabled](#module\_db\_disabled) | ../../ | n/a | | [security\_group](#module\_security\_group) | terraform-aws-modules/security-group/aws | ~> 4 | | [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 2 | diff --git a/examples/complete-postgres/README.md b/examples/complete-postgres/README.md index 89b0977a..eff2b7d6 100644 --- a/examples/complete-postgres/README.md +++ b/examples/complete-postgres/README.md @@ -30,9 +30,9 @@ No providers. | Name | Source | Version | |------|--------|---------| -| [db](#module\_db) | ../../ | | -| [db\_default](#module\_db\_default) | ../../ | | -| [db\_disabled](#module\_db\_disabled) | ../../ | | +| [db](#module\_db) | ../../ | n/a | +| [db\_default](#module\_db\_default) | ../../ | n/a | +| [db\_disabled](#module\_db\_disabled) | ../../ | n/a | | [security\_group](#module\_security\_group) | terraform-aws-modules/security-group/aws | ~> 4 | | [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 2 | diff --git a/examples/cross-region-replica-postgres/README.md b/examples/cross-region-replica-postgres/README.md index 032f5626..027bc4f6 100644 --- a/examples/cross-region-replica-postgres/README.md +++ b/examples/cross-region-replica-postgres/README.md @@ -30,8 +30,8 @@ No providers. | Name | Source | Version | |------|--------|---------| -| [master](#module\_master) | ../../ | | -| [replica](#module\_replica) | ../../ | | +| [master](#module\_master) | ../../ | n/a | +| [replica](#module\_replica) | ../../ | n/a | | [security\_group\_region1](#module\_security\_group\_region1) | terraform-aws-modules/security-group/aws | ~> 4 | | [security\_group\_region2](#module\_security\_group\_region2) | terraform-aws-modules/security-group/aws | ~> 4 | | [vpc\_region1](#module\_vpc\_region1) | terraform-aws-modules/vpc/aws | ~> 2.0 | diff --git a/examples/enhanced-monitoring/README.md b/examples/enhanced-monitoring/README.md index 55618a2b..c0bf6ab1 100644 --- a/examples/enhanced-monitoring/README.md +++ b/examples/enhanced-monitoring/README.md @@ -34,7 +34,7 @@ Note that this example may create resources which cost money. Run `terraform des | Name | Source | Version | |------|--------|---------| -| [db](#module\_db) | ../../ | | +| [db](#module\_db) | ../../ | n/a | | [security\_group](#module\_security\_group) | terraform-aws-modules/security-group/aws | ~> 4 | | [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 2 | diff --git a/examples/groups/README.md b/examples/groups/README.md index 76d7d8c5..679018ff 100644 --- a/examples/groups/README.md +++ b/examples/groups/README.md @@ -30,11 +30,11 @@ No providers. | Name | Source | Version | |------|--------|---------| -| [byo\_mysql](#module\_byo\_mysql) | ../../ | | -| [default\_mysql](#module\_default\_mysql) | ../../ | | -| [default\_mysql\_default\_aws](#module\_default\_mysql\_default\_aws) | ../../ | | -| [default\_mysql\_name](#module\_default\_mysql\_name) | ../../ | | -| [default\_postgres](#module\_default\_postgres) | ../../ | | +| [byo\_mysql](#module\_byo\_mysql) | ../../ | n/a | +| [default\_mysql](#module\_default\_mysql) | ../../ | n/a | +| [default\_mysql\_default\_aws](#module\_default\_mysql\_default\_aws) | ../../ | n/a | +| [default\_mysql\_name](#module\_default\_mysql\_name) | ../../ | n/a | +| [default\_postgres](#module\_default\_postgres) | ../../ | n/a | ## Resources diff --git a/examples/replica-mysql/README.md b/examples/replica-mysql/README.md index ce84c2ba..5cabccf4 100644 --- a/examples/replica-mysql/README.md +++ b/examples/replica-mysql/README.md @@ -30,8 +30,8 @@ No providers. | Name | Source | Version | |------|--------|---------| -| [master](#module\_master) | ../../ | | -| [replica](#module\_replica) | ../../ | | +| [master](#module\_master) | ../../ | n/a | +| [replica](#module\_replica) | ../../ | n/a | | [security\_group](#module\_security\_group) | terraform-aws-modules/security-group/aws | ~> 4 | | [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 2.0 | diff --git a/examples/replica-postgres/README.md b/examples/replica-postgres/README.md index bc933b8b..b0cf3af2 100644 --- a/examples/replica-postgres/README.md +++ b/examples/replica-postgres/README.md @@ -30,8 +30,8 @@ No providers. | Name | Source | Version | |------|--------|---------| -| [master](#module\_master) | ../../ | | -| [replica](#module\_replica) | ../../ | | +| [master](#module\_master) | ../../ | n/a | +| [replica](#module\_replica) | ../../ | n/a | | [security\_group](#module\_security\_group) | terraform-aws-modules/security-group/aws | ~> 4 | | [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 2.0 | diff --git a/examples/s3-import-mysql/README.md b/examples/s3-import-mysql/README.md index 372a35ef..e2eb86bd 100644 --- a/examples/s3-import-mysql/README.md +++ b/examples/s3-import-mysql/README.md @@ -63,7 +63,7 @@ Note that this example may create resources which cost money. Run `terraform des | Name | Source | Version | |------|--------|---------| -| [db](#module\_db) | ../../ | | +| [db](#module\_db) | ../../ | n/a | | [import\_s3\_bucket](#module\_import\_s3\_bucket) | terraform-aws-modules/s3-bucket/aws | ~> 2.0 | | [security\_group](#module\_security\_group) | terraform-aws-modules/security-group/aws | ~> 4 | | [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 2.0 | diff --git a/modules/db_option_group/main.tf b/modules/db_option_group/main.tf index 0107158c..6ae35840 100644 --- a/modules/db_option_group/main.tf +++ b/modules/db_option_group/main.tf @@ -48,4 +48,3 @@ resource "aws_db_option_group" "this" { create_before_destroy = true } } - diff --git a/modules/db_option_group/outputs.tf b/modules/db_option_group/outputs.tf index c3ca269c..5ef4b22c 100644 --- a/modules/db_option_group/outputs.tf +++ b/modules/db_option_group/outputs.tf @@ -7,4 +7,3 @@ output "db_option_group_arn" { description = "The ARN of the db option group" value = element(concat(aws_db_option_group.this.*.arn, [""]), 0) } - diff --git a/modules/db_parameter_group/main.tf b/modules/db_parameter_group/main.tf index c6a56004..94acbe5e 100644 --- a/modules/db_parameter_group/main.tf +++ b/modules/db_parameter_group/main.tf @@ -33,4 +33,3 @@ resource "aws_db_parameter_group" "this" { create_before_destroy = true } } - diff --git a/modules/db_subnet_group/outputs.tf b/modules/db_subnet_group/outputs.tf index 26c2b9df..4ef75253 100644 --- a/modules/db_subnet_group/outputs.tf +++ b/modules/db_subnet_group/outputs.tf @@ -7,4 +7,3 @@ output "db_subnet_group_arn" { description = "The ARN of the db subnet group" value = element(concat(aws_db_subnet_group.this.*.arn, [""]), 0) } - diff --git a/modules/db_subnet_group/variables.tf b/modules/db_subnet_group/variables.tf index a4e33649..802f5e74 100644 --- a/modules/db_subnet_group/variables.tf +++ b/modules/db_subnet_group/variables.tf @@ -33,4 +33,3 @@ variable "tags" { type = map(string) default = {} } - From f86d65994a1bdc8ae0be8c0ea2a93391829c2194 Mon Sep 17 00:00:00 2001 From: Bryant Biggs Date: Tue, 26 Oct 2021 12:07:47 -0400 Subject: [PATCH 02/11] chore: need to have both current and future branch names --- .releaserc.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.releaserc.json b/.releaserc.json index a8889815..d5aac300 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -1,6 +1,7 @@ { "branches": [ - "main" + "main", + "master" ], "ci": false, "plugins": [ From 9afa01b9b740dfe8a85ef05b8c05c6e8d422b7a7 Mon Sep 17 00:00:00 2001 From: Bryant Biggs Date: Tue, 26 Oct 2021 12:09:24 -0400 Subject: [PATCH 03/11] chore: add a change to ensure release workflow is run --- main.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/main.tf b/main.tf index d7953c3c..7f96c101 100644 --- a/main.tf +++ b/main.tf @@ -9,6 +9,7 @@ locals { } # Random string to use as master password +# Temporary whitespace change - TODO remove me resource "random_password" "master_password" { count = var.create_db_instance && var.create_random_password ? 1 : 0 From 304e5df9740952c02355b40e108b8db5e71fd7c4 Mon Sep 17 00:00:00 2001 From: Bryant Biggs Date: Tue, 26 Oct 2021 12:19:06 -0400 Subject: [PATCH 04/11] chore: remove comment added to trigger worfklow --- main.tf | 1 - 1 file changed, 1 deletion(-) diff --git a/main.tf b/main.tf index 7f96c101..d7953c3c 100644 --- a/main.tf +++ b/main.tf @@ -9,7 +9,6 @@ locals { } # Random string to use as master password -# Temporary whitespace change - TODO remove me resource "random_password" "master_password" { count = var.create_db_instance && var.create_random_password ? 1 : 0 From df10f4497f88e62946c2f90ef096136e4fe0c3b7 Mon Sep 17 00:00:00 2001 From: Bryant Biggs Date: Tue, 26 Oct 2021 13:13:52 -0400 Subject: [PATCH 05/11] Update .pre-commit-config.yaml Co-authored-by: Anton Babenko --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 36405d17..254b108f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ repos: - - repo: git://github.com/antonbabenko/pre-commit-terraform + - repo: https://github.com/antonbabenko/pre-commit-terraform rev: v1.53.0 hooks: - id: terraform_fmt From 48c770a3daa1c421fc601f8215009bdfdd6ddc7f Mon Sep 17 00:00:00 2001 From: Bryant Biggs Date: Tue, 26 Oct 2021 13:16:44 -0400 Subject: [PATCH 06/11] chore: update to remove redundant hook and set semantic-release version --- .github/workflows/release.yml | 1 + .pre-commit-config.yaml | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4bb4b71e..0385e0fa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,6 +22,7 @@ jobs: - name: Release uses: cycjimmy/semantic-release-action@v2 with: + semantic_version: 18.0.0 extra_plugins: | @semantic-release/changelog@6.0.0 @semantic-release/git@10.0.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 254b108f..d6f7ca37 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,5 +26,4 @@ repos: rev: v4.0.1 hooks: - id: check-merge-conflict - - id: trailing-whitespace - id: end-of-file-fixer From 6dbc2fe2d5b9583e15db2b28dda835ad6b504195 Mon Sep 17 00:00:00 2001 From: Bryant Biggs Date: Tue, 26 Oct 2021 14:32:52 -0400 Subject: [PATCH 07/11] chore: update release workflow to use PAT --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0385e0fa..1af65e79 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,6 +17,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: + persist-credentials: false fetch-depth: 0 - name: Release @@ -27,4 +28,4 @@ jobs: @semantic-release/changelog@6.0.0 @semantic-release/git@10.0.0 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }} From 588f70ea1953823f40935d8f5b002b21695720c6 Mon Sep 17 00:00:00 2001 From: Bryant Biggs Date: Wed, 27 Oct 2021 09:19:00 -0400 Subject: [PATCH 08/11] chore: trigger release workflow on any terraform or python file changes --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1af65e79..75567201 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,8 +6,8 @@ on: - main - master paths: - - '*.tf' - - 'modules/**/*.tf' + - '**/*.py' + - '**/*.tf' jobs: release: From 7c362ada48da40b80ee6c9b75c1bb557a9cef8c4 Mon Sep 17 00:00:00 2001 From: Bryant Biggs Date: Wed, 27 Oct 2021 11:46:48 -0400 Subject: [PATCH 09/11] chore: bump pre-commit to latest --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d6f7ca37..7d00e08f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/antonbabenko/pre-commit-terraform - rev: v1.53.0 + rev: v1.55.0 hooks: - id: terraform_fmt - id: terraform_validate From 4acaf8f73e9acb0c69fc9cd05830b57a1f4580ae Mon Sep 17 00:00:00 2001 From: Bryant Biggs Date: Sat, 30 Oct 2021 17:51:22 -0400 Subject: [PATCH 10/11] chore: update changelog header --- .releaserc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.releaserc.json b/.releaserc.json index d5aac300..ca52a586 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -12,7 +12,7 @@ "@semantic-release/changelog", { "changelogFile": "CHANGELOG.md", - "changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file. See\n[Conventional Commits](https://conventionalcommits.org) for commit guidelines." + "changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file" } ], [ From 94abe7fcbaab23ba237ee9555dc369eb1c811f5e Mon Sep 17 00:00:00 2001 From: Anton Babenko Date: Sun, 7 Nov 2021 19:39:43 +0100 Subject: [PATCH 11/11] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7d00e08f..5b2976b4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - '--args=--only=terraform_required_providers' - '--args=--only=terraform_standard_module_structure' - '--args=--only=terraform_workspace_remote' - - repo: git://github.com/pre-commit/pre-commit-hooks + - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.0.1 hooks: - id: check-merge-conflict