From dcec2e160452a42d7e9b8793bae3525d90b5512d Mon Sep 17 00:00:00 2001 From: Derek Rada Date: Thu, 20 Feb 2020 21:34:08 -0600 Subject: [PATCH 1/2] chore: prepare release v1.0.7 --- Dockerfile | 2 +- README.md | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 003df12..8222c64 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM derekrada/terraform-docs:latest +FROM derekrada/terraform-docs:v1.0.7 COPY ./src/common.sh /common.sh COPY ./src/docker-entrypoint.sh /docker-entrypoint.sh diff --git a/README.md b/README.md index cc8cebe..5b6bcd8 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # terraform-docs A Github action for generating terraform module documentation using terraform-docs and gomplate. In addition to statically defined directory modules, this module can search specific sub folders or parse atlantis.yaml for module identification and doc generation. This action has the ability to auto commit docs to an open PR or after a push to a specific branch. ## Version -v1.0.6 +v1.0.7 -Using [terraform-docs](https://github.com/segmentio/terraform-docs) v0.8.0, which is supported and tested on terraform version 0.11+ & 0.12+ but may work for others. +Using [terraform-docs](https://github.com/segmentio/terraform-docs) v0.8.2, which is supported and tested on terraform version 0.11+ & 0.12+ but may work for others. @@ -22,7 +22,7 @@ jobs: ref: ${{ github.event.pull_request.head.ref }} - name: Render terraform docs inside the USAGE.md and push changes back to PR branch - uses: Dirrk/terraform-docs@v1.0.6 + uses: Dirrk/terraform-docs@v1.0.7 with: tf_docs_working_dir: . tf_docs_output_file: USAGE.md @@ -118,7 +118,7 @@ jobs: ## Simple / Single folder ``` - name: Generate TF Docs - uses: Dirrk/terraform-docs@v1.0.6 + uses: Dirrk/terraform-docs@v1.0.7 with: tf_docs_working_dir: . tf_docs_output_file: README.md @@ -127,7 +127,7 @@ jobs: ## Multi folder ``` - name: Generate TF Docs - uses: Dirrk/terraform-docs@v1.0.6 + uses: Dirrk/terraform-docs@v1.0.7 with: tf_docs_working_dir: .,example1,example3/modules/test tf_docs_output_file: README.md @@ -136,7 +136,7 @@ jobs: ## Use atlantis.yaml v3 to find all dirs ``` - name: Generate TF docs - uses: Dirrk/terraform-docs@v1.0.6 + uses: Dirrk/terraform-docs@v1.0.7 with: tf_docs_atlantis_file: atlantis.yaml ``` @@ -144,9 +144,9 @@ jobs: ## Find all .tf file folders under a given directory ```yaml - name: Generate TF docs - uses: Dirrk/terraform-docs@v1.0.6 + uses: Dirrk/terraform-docs@v1.0.7 with: tf_docs_find_dir: examples/ ``` -Complete examples can be found [here](https://github.com/Dirrk/terraform-docs/tree/v1.0.6/examples) +Complete examples can be found [here](https://github.com/Dirrk/terraform-docs/tree/v1.0.7/examples) From 4b986daca70f52023003cb14e8783cc624d77505 Mon Sep 17 00:00:00 2001 From: Derek Rada Date: Thu, 20 Feb 2020 21:38:23 -0600 Subject: [PATCH 2/2] chore: added release scripts --- scripts/pre-release.sh | 30 ++++++++++++++++++++++++++++++ scripts/release.sh | 20 ++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100755 scripts/pre-release.sh create mode 100755 scripts/release.sh diff --git a/scripts/pre-release.sh b/scripts/pre-release.sh new file mode 100755 index 0000000..0e280ef --- /dev/null +++ b/scripts/pre-release.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +set -e + +NEW_VERSION=$1 + +if [ -z "${NEW_VERSION}" ]; then + echo "Must have version like: v1.0.1" + exit 1 +fi + +CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) + +if [[ "${CURRENT_BRANCH}" == "master" ]]; then + git pull origin master + git checkout -b "release/${NEW_VERSION}" +elif [[ "${CURRENT_BRANCH}" == "release/${NEW_VERSION}" ]]; then + git pull origin master +else + echo "Invalid branch" + exit 1 +fi + +# Update the README +VERSION=$NEW_VERSION gomplate -d action=action.yml -f .github/templates/README.tpl -o README.md + +# Update Dockerfile +gsed -i "s|FROM derekrada/terraform-docs:.*|FROM derekrada/terraform-docs:${NEW_VERSION}|" ./Dockerfile + +git commit -am "chore: prepare release ${NEW_VERSION}" +git push --set-upstream origin "release/${NEW_VERSION}" diff --git a/scripts/release.sh b/scripts/release.sh new file mode 100755 index 0000000..4ac4067 --- /dev/null +++ b/scripts/release.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -e + +CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) + +if [[ "${CURRENT_BRANCH}" != "master" ]]; then + echo "Must be on master" + exit 1 +fi + +NEW_VERSION=$1 + +if [ -z "${NEW_VERSION}" ]; then + echo "Must have version like: v1.0.1" + exit 1 +fi + +git pull origin master +git tag "${NEW_VERSION}" +git push --tags