Skip to content

Commit

Permalink
ci: Add CI validation step to ensure that plugin documentation is up-…
Browse files Browse the repository at this point in the history
…to-date

Issue #8
  • Loading branch information
MatthewJohn committed Aug 22, 2023
1 parent b8fc48c commit 0ba4a15
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,35 @@ cache:
- .cache/pip
- venv/


test-docs:
stage: test
image: golang:1.20-bullseye
cache:
paths:
- /usr/bin/tfplugindocs
script: |
# Install tfplugindocs
if [ ! -f "/usr/bin/tfplugindocs/tfplugindocs" ]
then
mkdir /usr/bin/tfplugindocs
apt-get update
apt-get install wget unzip --assume-yes
apt-get clean all
pushd /usr/bin/tfplugindocs
wget https://github.com/hashicorp/terraform-plugin-docs/releases/download/v0.16.0/tfplugindocs_0.16.0_linux_arm64.zip
unzip tfplugindocs_0.16.0_linux_arm64.zip
popd
fi
# Generate documentation
/usr/bin/tfplugindocs/tfplugindocs generate
# Check if there are any changes
if [ "$(git diff | wc -l)" != "0" ]
then
echo Documentation needs re-generating
exit 1
fi
release:
stage: deploy
image: semantic-release:latest
Expand Down

0 comments on commit 0ba4a15

Please sign in to comment.