diff --git a/Dockerfile.golang b/Dockerfile.golang new file mode 100644 index 0000000..b892985 --- /dev/null +++ b/Dockerfile.golang @@ -0,0 +1,23 @@ +FROM golang:1.11 + +### +# Set up the working directory +# +ENV CODES_DIR /codes +RUN mkdir -p "${CODES_DIR}" +WORKDIR "${CODES_DIR}" + +### +# Install utilities +# +RUN go get github.com/segmentio/terraform-docs + +### +# Install codes +# +COPY . . + +### +# What we need is.. bash! +# +CMD [ "bash" ] diff --git a/README.md b/README.md index a91e16a..1805310 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,22 @@ resource "aws_cloudfront_distribution" "your_distribution" { } ``` -## License +## Arguments and Outputs + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|:----:|:-----:|:-----:| +| basic\_auth\_credentials | Credentials for Basic Authentication. Pass a map composed of 'user' and 'password'. | map | n/a | yes | +| function\_name | Lambda function name | string | `"basicAuth"` | no | + +## Outputs + +| Name | Description | +|------|-------------| +| lambda\_arn | Lambda function ARN with version | + +# License Copyright © 2019 Naoto Yokoyama diff --git a/build.sh b/build.sh index 23e169d..f5b5d18 100755 --- a/build.sh +++ b/build.sh @@ -13,4 +13,5 @@ set -o xtrace __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +docker-compose build dev docker-compose run --rm dev npm run build diff --git a/clean.sh b/clean.sh index 1f1b267..beaea28 100755 --- a/clean.sh +++ b/clean.sh @@ -13,4 +13,5 @@ set -o xtrace __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +docker-compose build dev docker-compose run --rm dev npm run clean diff --git a/docker-compose.yml b/docker-compose.yml index ecb74dd..dc8ed84 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,3 +5,10 @@ services: volumes: - .:/codes/ - /codes/node_modules + docs: + build: + context: . + dockerfile: Dockerfile.golang + command: terraform-docs markdown table ./module + volumes: + - .:/codes/ diff --git a/docs.sh b/docs.sh new file mode 100755 index 0000000..aeb0434 --- /dev/null +++ b/docs.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# +# Generates the module markdown documents by terraform-docs. +# +# Usage: +# ./docs.sh +# + +set -o errexit +set -o nounset +set -o pipefail +#set -o xtrace + +__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +docker-compose build docs 2>/dev/null 1>/dev/null +docker-compose run --rm docs