From b2fd336e6e92c4edba84d24637c57bf0d55005d1 Mon Sep 17 00:00:00 2001 From: Khosrow Moossavi Date: Mon, 17 May 2021 18:09:11 -0400 Subject: [PATCH] Update terraform-docs to v0.13.0 Signed-off-by: Khosrow Moossavi --- .github/templates/README.tpl | 2 +- Dockerfile | 7 +------ README.md | 2 +- examples/tf12_config/.terraform-docs.yml | 3 +-- src/docker-entrypoint.sh | 8 +++++++- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/templates/README.tpl b/.github/templates/README.tpl index 804d5a4..2639b81 100644 --- a/.github/templates/README.tpl +++ b/.github/templates/README.tpl @@ -12,7 +12,7 @@ branch. ## Version -`{{ $version }}` (uses [terraform-docs] v0.12.1, which is supported and tested on Terraform +`{{ $version }}` (uses [terraform-docs] v0.13.0, which is supported and tested on Terraform version 0.11+ and 0.12+ but may work for others.) {{- if eq $version "main" }} diff --git a/Dockerfile b/Dockerfile index d31d5e5..96e6637 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,12 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM quay.io/terraform-docs/terraform-docs:0.12.1 - -# this can be removed when base image -# was upgraded to alpine:3.13 which has -# 'yq' in its repository out of the box. -RUN echo "http://dl-4.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories +FROM quay.io/terraform-docs/terraform-docs:0.13.0 RUN set -x \ && apk update \ diff --git a/README.md b/README.md index 7423670..31b1fea 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ branch. ## Version -`v0.6.1` (uses [terraform-docs] v0.12.1, which is supported and tested on Terraform +`v0.6.1` (uses [terraform-docs] v0.13.0, which is supported and tested on Terraform version 0.11+ and 0.12+ but may work for others.) ## Usage diff --git a/examples/tf12_config/.terraform-docs.yml b/examples/tf12_config/.terraform-docs.yml index 1e0cf5d..b003815 100644 --- a/examples/tf12_config/.terraform-docs.yml +++ b/examples/tf12_config/.terraform-docs.yml @@ -5,7 +5,6 @@ sections: - inputs sort: enabled: true - by: - - required + by: required settings: indent: 3 diff --git a/src/docker-entrypoint.sh b/src/docker-entrypoint.sh index 8e5a44e..38d18db 100755 --- a/src/docker-entrypoint.sh +++ b/src/docker-entrypoint.sh @@ -112,7 +112,13 @@ update_doc() { # shellcheck disable=SC2086 if [ -n "${CONFIG_FILE}" ] && [ "${CONFIG_FILE}" != "disabled" ]; then echo "::debug file=entrypoint.sh,line=80 command=terraform-docs --config ${CONFIG_FILE} ${ARGS} ${working_dir}" - terraform-docs --config ${CONFIG_FILE} ${ARGS} ${working_dir} >/tmp/tf_generated + local config_file + if [ -f "${CONFIG_FILE}" ]; then + config_file="${CONFIG_FILE}" + else + config_file="${working_dir}/${CONFIG_FILE}" + fi + terraform-docs --config ${config_file} ${ARGS} ${working_dir} >/tmp/tf_generated success=$? else echo "::debug file=entrypoint.sh,line=84 command=terraform-docs ${OUTPUT_FORMAT} ${ARGS} ${working_dir}"