Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: prepare release v1.0.7 #16

Merged
merged 2 commits into from
Feb 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.



Expand All @@ -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/[email protected].6
uses: Dirrk/[email protected].7
with:
tf_docs_working_dir: .
tf_docs_output_file: USAGE.md
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
## Simple / Single folder
```
- name: Generate TF Docs
uses: Dirrk/[email protected].6
uses: Dirrk/[email protected].7
with:
tf_docs_working_dir: .
tf_docs_output_file: README.md
Expand All @@ -127,7 +127,7 @@ jobs:
## Multi folder
```
- name: Generate TF Docs
uses: Dirrk/[email protected].6
uses: Dirrk/[email protected].7
with:
tf_docs_working_dir: .,example1,example3/modules/test
tf_docs_output_file: README.md
Expand All @@ -136,17 +136,17 @@ jobs:
## Use atlantis.yaml v3 to find all dirs
```
- name: Generate TF docs
uses: Dirrk/[email protected].6
uses: Dirrk/[email protected].7
with:
tf_docs_atlantis_file: atlantis.yaml
```

## Find all .tf file folders under a given directory
```yaml
- name: Generate TF docs
uses: Dirrk/[email protected].6
uses: Dirrk/[email protected].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)
30 changes: 30 additions & 0 deletions scripts/pre-release.sh
Original file line number Diff line number Diff line change
@@ -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}"
20 changes: 20 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -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