Skip to content

Commit

Permalink
Rename action to dnx-terraform-docs
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Diniz <arthurbdiniz@gmail.com>
  • Loading branch information
arthurbdiniz committed May 29, 2020
1 parent 0cc0246 commit f6b9e5b
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 36 deletions.
27 changes: 26 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
FROM derekrada/terraform-docs:v1.0.7
FROM golang:1.13-alpine3.10 as builder
ARG VERSION=v0.9.1

# Install dependencies
RUN set -x \
&& apk add --no-cache \
bash \
curl \
gcc \
git \
make \
wget \
&& GO111MODULE="on" go get "github.com/segmentio/terraform-docs@${VERSION}"

RUN set -x \
&& mkdir -p /outputs \
&& wget -O yq https://github.com/mikefarah/yq/releases/download/2.4.1/yq_linux_amd64 \
&& chmod 755 yq \
&& mv yq /outputs/yq

FROM alpine:3.10
COPY --from=builder /go/bin/terraform-docs /usr/local/bin/terraform-docs
COPY --from=builder /outputs/* /usr/local/bin/

RUN apk add --no-cache bash sed git jq

COPY ./src/common.sh /common.sh
COPY ./src/docker-entrypoint.sh /docker-entrypoint.sh

Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 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.7
v1.0.0

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/terraform-docs@v1.0.7
uses: DNXLabs/terraform-docs@v1.0.0
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/terraform-docs@v1.0.7
uses: DNXLabs/terraform-docs@v1.0.0
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/terraform-docs@v1.0.7
uses: DNXLabs/terraform-docs@v1.0.0
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/terraform-docs@v1.0.7
uses: DNXLabs/terraform-docs@v1.0.0
with:
tf_docs_atlantis_file: atlantis.yaml
```

## Find all .tf file folders under a given directory
```yaml
- name: Generate TF docs
uses: Dirrk/terraform-docs@v1.0.7
uses: DNXLabs/terraform-docs@v1.0.0
with:
tf_docs_find_dir: examples/
```

Complete examples can be found [here](https://github.com/Dirrk/terraform-docs/tree/v1.0.7/examples)
Complete examples can be found [here](https://github.com/DNXLabs/terraform-docs/tree/master/examples)
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: terraform-docs
name: dnx-terraform-docs
author: Derek Rada
description: A Github action for generating terraform module documentation using terraform-docs and gomplate.
inputs:
Expand Down
27 changes: 0 additions & 27 deletions docker/Dockerfile

This file was deleted.

0 comments on commit f6b9e5b

Please sign in to comment.