Skip to content

Commit 27f96ab

Browse files
authored
Merge pull request #22 from cytopia/fix-build
Fix build of latest version
2 parents 17720c6 + 00fd835 commit 27f96ab

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ FROM golang:alpine3.9 as builder
33
# Install dependencies
44
RUN set -x \
55
&& apk add --no-cache \
6+
bash \
67
curl \
78
gcc \
89
git \
@@ -29,6 +30,12 @@ RUN set -x \
2930
&& sed -i'' 's/windows//g' Makefile \
3031
&& make \
3132
&& mv dist/terraform-docs_linux_amd64 /usr/local/bin/terraform-docs; \
33+
# Build terraform-docs latest
34+
elif [ "${VERSION}" = "latest" ]; then \
35+
go get github.com/mitchellh/gox \
36+
&& make test \
37+
&& make build-all GOOS=linux GOARCH=amd64 \
38+
&& mv bin/linux-amd64/terraform-docs /usr/local/bin/terraform-docs; \
3239
# Build terraform-docs > 0.3.0
3340
else \
3441
make deps \
@@ -47,7 +54,7 @@ RUN set -x \
4754
&& if [ "${VERSION}" != "latest" ]; then \
4855
terraform-docs --version | grep "${VERSION}"; \
4956
else \
50-
terraform-docs --version | grep -E "(terraform-docs[[:space:]])?(version[[:space:]])?dev"; \
57+
terraform-docs --version | grep -E "(terraform-docs[[:space:]])?(version[[:space:]])?(dev|latest)"; \
5158
fi
5259

5360

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ _test-version:
4343
| head -1 \
4444
| sed 's/.*v//g' \
4545
)"; \
46-
echo "Testing for latest: dev"; \
47-
if ! docker run --rm $(IMAGE) | grep -E "^(terraform-docs[[:space:]])?(version[[:space:]])?dev"; then \
46+
echo "Testing for latest: (dev|latest)"; \
47+
if ! docker run --rm $(IMAGE) | grep -E "^(terraform-docs[[:space:]])?(version[[:space:]])?(dev|latest)"; then \
4848
echo "Failed"; \
4949
exit 1; \
5050
fi; \

0 commit comments

Comments
 (0)